BUGFIX: fix query error when image search doesn't use legacy search

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@106183 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Saophalkun Ponlu 2010-06-04 00:28:29 +00:00 committed by Sam Minnee
parent b20a69dd04
commit 53646b3187

View File

@ -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%'";
}