Bug #23245
closedArgument 3 passed to t3lib_frontendedit::displayEditIcons() must be an array, null given
0%
Description
I have cleared display of displayEditIcons, so the icons don't show up, even when frontend editing is active. It appears, that typoscript sets the configuration of rendering the element to null. Php throws an error, because the rendering gets delegated to another function which excepts only an array as third parameter.
I am not sure how I made Typoscript set the value to null, but this can be fixed with the following workaround:
/*around line 7911 in class.tslib_content.php:
change
$GLOBALS['BE_USER']->frontendEdit->displayEditIcons($content, $params, $conf, $currentRecord, $dataArr, $addURLParamStr);
to */
if(isset($conf) && is_array($conf)){
$content = $GLOBALS['BE_USER']->frontendEdit->displayEditIcons($content, $params, $conf, $currentRecord, $dataArr, $addURLParamStr);
} else {
$content = $GLOBALS['BE_USER']->frontendEdit->displayEditIcons($content, $params, array(), $currentRecord, $dataArr, $addURLParamStr);
}
I am not sure which of the following is relevant to the problem, as I don't know anything about the applicable coding policy:
- Typoscript shouldn't be able to set a value to null, which is expected to be an array
- A function should not expect an array, when a value could be null.
- A function should not delegate values before checking wether they are valid.
(issue imported from #M15194)
Files