[BUGFIX] Do not show hidden tables in LiveSearch 32/53032/2
authorSusanne Moog <susanne.moog@typo3.com>
Fri, 2 Jun 2017 10:20:37 +0000 (12:20 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 2 Jun 2017 12:39:44 +0000 (14:39 +0200)
LiveSearch did not check whether the tables were
allowed to be shown (via TCA ctrl hideTable) and
displayed results that were not available after
clicking 'show all'.

Change-Id: I90f61e1156c446cd399c0f26b96bbd30c747554d
Releases: master, 8.7
Resolves: #75651
Reviewed-on: https://review.typo3.org/53032
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php

index 847934a..7c035a5 100644 (file)
@@ -141,8 +141,14 @@ class LiveSearch
         $limit = $this->limitCount;
         $getRecordArray = [];
         foreach ($GLOBALS['TCA'] as $tableName => $value) {
-            // if no access for the table (read or write), skip this table
-            if (!$GLOBALS['BE_USER']->check('tables_select', $tableName) && !$GLOBALS['BE_USER']->check('tables_modify', $tableName)) {
+            // if no access for the table (read or write) or table is hidden, skip this table
+            if (
+                (
+                    !$GLOBALS['BE_USER']->check('tables_select', $tableName) &&
+                    !$GLOBALS['BE_USER']->check('tables_modify', $tableName)
+                ) ||
+                (isset($value['ctrl']['hideTable']) && $value['ctrl']['hideTable'])
+            ) {
                 continue;
             }
             $recordArray = $this->findByTable($tableName, $pageIdList, 0, $limit);