Navigation Menu

Skip to content

Commit

Permalink
[BUGFIX] Prevent PHP 8 warning in FLUIDTEMPLATE variable resolving
Browse files Browse the repository at this point in the history
Prevent PHP 8 undefined array key warning when resolving
a FLUIDTEMPLATE variable value from a TypoScript reference:

10 = FLUIDTEMPLATE
10 {
    variables {
        myvar =< lib.some.cobject
    }
}

Resolves: #95672
Releases: master
Change-Id: I641a6522805c770c3242ea93673961c6201ff9f7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71838
Tested-by: core-ci <typo3@b13.com>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
astehlik authored and lolli42 committed Oct 17, 2021
1 parent 31f9a1c commit 6f865ea
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -301,7 +301,8 @@ protected function getContentObjectVariables(array $conf)
continue;
}
if (!in_array($variableName, $reservedVariables)) {
$variables[$variableName] = $this->cObj->cObjGetSingle($cObjType, $variablesToProcess[$variableName . '.'], 'variables.' . $variableName);
$cObjConf = $variablesToProcess[$variableName . '.'] ?? [];
$variables[$variableName] = $this->cObj->cObjGetSingle($cObjType, $cObjConf, 'variables.' . $variableName);
} else {
throw new \InvalidArgumentException(
'Cannot use reserved name "' . $variableName . '" as variable name in FLUIDTEMPLATE.',
Expand Down

0 comments on commit 6f865ea

Please sign in to comment.