Issue Bug Closed

#99213FrontendConfigurationManager - Undefined array key "recursive"

Moritz Noll 11/28/22, 14:17 updated 02/08/23, 16:04

Description

I get the following error.
*Undefined array key “recursive” in /var/www/typo3_src-11.5.19/typo3/sysext/extbase/Classes/Configuration/FrontendConfigurationManager.php line 129*

Maybe this is the solution.
Original code: https://github.com/TYPO3/typo3/blob/v11.5.19/typo3/sysext/extbase/Classes/Configuration/FrontendConfigurationManager.php#L124
Bring the line $this->contentObject->data[‘recursive’] to the top under $pages und return a default value if not exists.

protected function overrideStoragePidIfStartingPointIsSet(array $frameworkConfiguration): array
{
    $pages = $this->contentObject->data['pages'] ?? '';
    $recursive = $this->contentObject->data['recursive'] ?? '';
    if (is_string($pages) && $pages !== '') {
        $list = [];
        if ($recursive > 0) {
            $explodedPages = GeneralUtility::trimExplode(',', $pages);
            foreach ($explodedPages as $pid) {
                $pids = $this->contentObject->getTreeList($pid, $this->contentObject->data['recursive']);
                if ($pids !== '') {
                    $list[] = $pids;
                }
            }
        }
        if (!empty($list)) {
            $pages = $pages . ',' . implode(',', $list);
        }
        ArrayUtility::mergeRecursiveWithOverrule($frameworkConfiguration, [
            'persistence' => [
                'storagePid' => $pages,
            ],
        ]);
    }
    return $frameworkConfiguration;
}

Reviews 1