[BUGFIX] Livesearch does not find all pages
authorUdo Leimberger <udo@t3developer.de>
Mon, 22 Aug 2011 06:19:34 +0000 (08:19 +0200)
committerSteffen Ritter <info@rs-websystems.de>
Mon, 12 Mar 2012 16:10:13 +0000 (17:10 +0100)
If you are a BE user with various mount points (no admin), live search
does not find all pages.

Change-Id: I67e4fa56a8514f19cfbb8f181655c473a375ea5d
Resolves: #29086
Releases: 4.5, 4.6
Reviewed-on: http://review.typo3.org/7112
Reviewed-by: Markus Klein
Reviewed-by: Wouter Wolters
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
t3lib/search/class.t3lib_search_livesearch.php

index b7e0847..14f0320 100644 (file)
@@ -117,10 +117,13 @@ class t3lib_search_livesearch {
         */
        public function find($searchQuery) {
                $recordArray = array();
-               $pageIdList = $this->getAvailablePageIds(
-                       implode(',', $GLOBALS['BE_USER']->returnWebmounts()),
-                       self::RECURSIVE_PAGE_LEVEL
-               );
+               $pageList = array();
+               $mounts = $GLOBALS['BE_USER']->returnWebmounts();
+               foreach ($mounts as $pageId) {
+                       $pageList[] = $this->getAvailablePageIds($pageId, self::RECURSIVE_PAGE_LEVEL);
+               }
+               $pageIdList = implode(',', array_unique(explode(',', implode(',', $pageList))));
+               unset($pageList);
                $limit = $this->startCount . ',' . $this->limitCount;
 
                if ($this->queryParser->isValidCommand($searchQuery)) {