Actions
Bug #99213
closedFrontendConfigurationManager - Undefined array key "recursive"
Start date:
2022-11-28
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:
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;
}
Actions