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
Updated by Daniel Mueller over 14 years ago
PS:
This was the error reported by frontend:
t3lib_error_Exception
PHP Catchable Fatal Error: Argument 3 passed to t3lib_frontendedit::displayEditIcons() must be an array, null given, called in /home/u0052496198/public_html/typo3-4.3.3-update/cms/typo3/sysext/cms/tslib/class.tslib_content.php on line 7911 and defined in /home/u0052496198/public_html/typo3-4.3.3-update/cms/t3lib/class.t3lib_frontendedit.php line 135
Updated by Daniel Mueller over 14 years ago
PPS:
Version is Typo3 4.3.3 How do I change this?
Updated by Chris topher over 14 years ago
Hi ...?,
could you put your real name in the reporter field? You can do so here: http://typo3.org/register
That would make communication easier!
Please create a patch out of your changes and send it to the Core List!
See here for more information: http://typo3.org/teams/core/core-mailinglist-rules/
Updated by Heath Kouns almost 14 years ago
Hi,
I ran into this same issue last night when I upgraded to 4.4.6. I got the same error... (line numbers were slightly diffferent) It only showed up on two of the pages in my page tree... (and I couldn't figure out what was different) ... So I implemented the code change described above (directly...not a patch file) ... and it fixed the issue.
I see this issue is marked with status of "Feedback" ... is there a plan to incorporate it into the core? OR (and I guess this is my biggest concern) ... this is not the root cause and this fix is only a "band-aid"... If this is the case, is there another solution?
Thanks