Follow-up to #17032: Remove early return
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 14 Jan 2011 15:42:58 +0000 (15:42 +0000)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 14 Jan 2011 15:42:58 +0000 (15:42 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10072 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/search/class.t3lib_search_livesearch.php

index 5555b76..f3641f7 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-01-14  Christia Kuhn  <lolli@schwarzbu.ch>
+
+       * Follow-up to #17032: Remove early return
+
 2011-01-14  Ernesto Baschny  <ernst@cron-it.de>
 
        * Fixed bug #17032: Backend search throws Exceptions / SQL errors when running as non-admin
index 924d4e4..9044152 100644 (file)
@@ -187,21 +187,20 @@ class t3lib_search_livesearch {
         * @see extractSearchableFieldsFromTable()
         */
        protected function findByTable($tableName, $pageIdList, $limit) {
-               $getRecordArray = array();
                $fieldsToSearchWithin = $this->extractSearchableFieldsFromTable($tableName);
-               if (count($fieldsToSearchWithin) == 0) {
-                               // No field to search in this table
-                       return array();
+
+               $getRecordArray = array();
+               if (count($fieldsToSearchWithin) > 0) {
+                       $pageBasedPermission = ($tableName == 'pages' && $this->userPermissions) ? $this->userPermissions : '1=1 ';
+                       $where = 'pid IN(' . $pageIdList . ')' . $pageBasedPermission . $this->makeQuerySearchByTable($tableName, $fieldsToSearchWithin);
+                       $orderBy = $this->makeOrderByTable($tableName);
+                       $getRecordArray = $this->getRecordArray(
+                               $tableName,
+                               $pageBasedPermission . $this->makeQuerySearchByTable($tableName, $fieldsToSearchWithin),
+                               $this->makeOrderByTable($tableName),
+                               $limit
+                       );
                }
-               $pageBasedPermission = ($tableName == 'pages' && $this->userPermissions) ? $this->userPermissions : '1=1 ';
-               $where = 'pid IN(' . $pageIdList . ')' . $pageBasedPermission . $this->makeQuerySearchByTable($tableName, $fieldsToSearchWithin);
-               $orderBy = $this->makeOrderByTable($tableName);
-               $getRecordArray = $this->getRecordArray(
-                       $tableName,
-                       $pageBasedPermission . $this->makeQuerySearchByTable($tableName, $fieldsToSearchWithin),
-                       $this->makeOrderByTable($tableName),
-                       $limit
-               );
 
                return $getRecordArray;
        }