From 6f41e77e51f397ef24e18334ff2473d83ab43e4c Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 15 Oct 2010 03:27:38 +0000 Subject: [PATCH] ENHANCEMENT: Prevent image search queries all images in the site initially when the page is loaded (from r106194) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@112577 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/ThumbnailStripField.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/ThumbnailStripField.php b/code/ThumbnailStripField.php index f1282d8a..d4f560c7 100755 --- a/code/ThumbnailStripField.php +++ b/code/ThumbnailStripField.php @@ -87,6 +87,9 @@ class ThumbnailStripField extends FormField { $whereSQL = "\"ParentID\" = 0"; } else { $whereSQL = ''; + + // Prevent image search queries all images in the site initially when the page is loaded + if(empty($searchText)) $whereSQL = "\"ParentID\" = 0"; } if($searchText) { @@ -125,7 +128,8 @@ class ThumbnailStripField extends FormField { } } $result .= ''; - } else { + } + else { if($folder) { $result = '

' . _t('ThumbnailStripField.NOFOLDERIMAGESFOUND', 'No images found in') . ' ' . $folder->Title . '

'; } else {