diff --git a/code/ThumbnailStripField.php b/code/ThumbnailStripField.php index 0481f030..97141e7e 100755 --- a/code/ThumbnailStripField.php +++ b/code/ThumbnailStripField.php @@ -81,11 +81,13 @@ class ThumbnailStripField extends FormField { } else { if (!self::$use_legacy_image_search) { - $whereSQL = "\"ParentID\" = 0 AND "; + $whereSQL = "\"ParentID\" = 0"; } else { $whereSQL = ''; } + if($searchText) { + if (!empty($whereSQL)) $whereSQL .= " AND"; $whereSQL .= " \"Filename\" LIKE '%$searchText%'"; }