Bug #23245

Argument 3 passed to t3lib_frontendedit::displayEditIcons() must be an array, null given

Added by Daniel Mueller almost 9 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2010-07-21
Due date:
% Done:

0%

TYPO3 Version:
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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)

bug_15194.diff View (1.06 KB) Administrator Admin, 2010-07-22 07:55


Related issues

Related to TYPO3 Core - Bug #22359: No FE editing with only field edit icons and with "old" feedit extension New 2010-03-31
Duplicates TYPO3 Core - Bug #23989: Argument 3 passed to t3lib_frontendedit::displayEditIcons() must be an array, null given Closed 2010-11-08

History

#1 Updated by Daniel Mueller almost 9 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

#2 Updated by Daniel Mueller almost 9 years ago

PPS:

Version is Typo3 4.3.3 How do I change this?

#3 Updated by Chris topher almost 9 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/

#4 Updated by Heath Kouns over 8 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

#5 Updated by Benni Mack 7 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF