BUGFIX: fix query error when image search doesn't use legacy search (from r106183)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@112491 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-10-15 02:36:47 +00:00
parent e4257b76f5
commit cd4fecb0ee

View File

@ -84,11 +84,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%'";
}