punktDe/pt_extlist

String passed by reference

Opened this issue · 2 comments

$specialValues = GeneralUtility::callUserFunction($rendererUserFunc, $cell, '');

The GeneralUtility::callUserFunction function expects the third parameter to be a value by reference.

At the moment PHP throws a fatal error:

Fatal error: Only variables can be passed by reference in /homepages/***/***/htdocs/website/typo3conf/ext/pt_extlist/Classes/Domain/Renderer/Default/CellRenderer.php on line 159

A quick and dirty fix is

$_fix = '';
$specialValues = GeneralUtility::callUserFunction($rendererUserFunc, $cell, $_fix);

I don't know what goes on under the hood, but maybe it would be better to simply pass $this?

Seems like a whole lot of other plugins just add $this. I think it might be a callback variable?

screen shot 2017-11-10 at 2 13 59 pm

Reference to be passed along (typically "$this" - being a reference to the calling object) (REFERENCE!)

The Typo3 documentation says explicit that one should pass a reference. Maybe we should indeed just pass $this according to your and the documentations suggestion.