Issue Bug Closed

#81779SuggestWizardDefaultReceiver overrides pids when pidList is used

Stefan Terborg 07/04/17, 09:46 updated 04/01/20, 21:14

Description

The suggest wizard can be configurated to use a list of pids (pidList) to search from. But the array of allowed pids is constructed the wrong way.

This happens in the constructor method in line 116 in combination with method getAllSubpagesOfPage:

111    if (isset($config['pidList'])) {
112        $allowedPages = ($pageIds = GeneralUtility::trimExplode(',', $config['pidList']));
113        $depth = (int)$config['pidDepth'];
114        foreach ($pageIds as $pageId) {
115            if ($pageId > 0) {
116                \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($allowedPages, $this->getAllSubpagesOfPage($pageId, $depth));
117            }
118        }
119        $this->allowedPages = array_unique($allowedPages);
120    }

Example:
pidList = 5,2,3
pidDepth = 0
results in $this->allowedPages: 3,2,3

Reason is that the array of pids has normal integer keys that get overriden when merged. Perhaps the pid array should take the pids as keys.

Reviews 2