[BUGFIX] Livesearch does not find all pages
authorUdo Leimberger <udo@t3developer.de>
Mon, 22 Aug 2011 06:19:34 +0000 (08:19 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Wed, 24 Aug 2011 20:01:48 +0000 (22:01 +0200)
If you are a BE user with various mount points (no admin), live search
does not find all pages.

Change-Id: Ie4c9c41f65d8a84722fa3847921912c7fb5a18f1
Resolves: #29086
Releases: 4.5, 4.6
Reviewed-on: http://review.typo3.org/4460
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
t3lib/search/class.t3lib_search_livesearch.php

index 1c332cd..c6c6fec 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)) {