Bug #21035
closedTCEforms suggest fails with PHP fatal error
0%
Description
TCEforms suggest feature sometimes fails for me with a PHP fatal error (shown for fractions of a second in the result ilst).
PHP Fatal error: Only variables can be passed by reference in .../t3lib/tceforms/class.t3lib_tceforms_suggest_defaultreceiver.php on line 218
If I understand the code, this code is executed, if results are found, but not in a mount of the current user. Then a new search is started to get more results and this error produced.
Indeed I never got this error, when I was admin.
It seems to be this problem: http://the-stickman.com/web-development/php/php-505-fatal-error-only-variables-can-be-passed-by-reference/
If I change
$tmp = self::queryTable($this->params['value'], $recursionCounter);
to
$tmp = self::queryTable($foo = $this->params['value'], ++$recursionCounter);
everything works fine
Stack trace:
[Fri Sep 11 11:09:47 2009] [error] [client 127.0.0.1] PHP Fatal error: Only variables can be passed by reference in /Applications/MAMP/htdocs/vhosts/fw/typo3_src/t3lib/tceforms/class.t3lib_tceforms_suggest_defaultreceiver.php on line 218, referer: http://localhost/typo3/alt_doc.php?edit[pages]5407=edit&returnUrl=http%3A%2F%2Flocalhost%2Ftypo3%2Fsysext%2Fcms%2Flayout%2Fdb_layout.php
[Fri Sep 11 11:09:47 2009] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://localhost/typo3/alt_doc.php?edit[pages]5407=edit&returnUrl=http%3A%2F%2Flocalhost%2Ftypo3%2Fsysext%2Fcms%2Flayout%2Fdb_layout.php
[Fri Sep 11 11:09:47 2009] [error] [client 127.0.0.1] PHP 1. {main}() /Applications/MAMP/htdocs/vhosts/fw/typo3_src/typo3/ajax.php:0, referer: http://localhost/typo3/alt_doc.php?edit[pages]5407=edit&returnUrl=http%3A%2F%2Flocalhost%2Ftypo3%2Fsysext%2Fcms%2Flayout%2Fdb_layout.php
[Fri Sep 11 11:09:47 2009] [error] [client 127.0.0.1] PHP 2. t3lib_div::callUserFunction() /Applications/MAMP/htdocs/vhosts/fw/typo3_src/typo3/ajax.php:72, referer: http://localhost/typo3/alt_doc.php?edit[pages]5407=edit&returnUrl=http%3A%2F%2Flocalhost%2Ftypo3%2Fsysext%2Fcms%2Flayout%2Fdb_layout.php
[Fri Sep 11 11:09:47 2009] [error] [client 127.0.0.1] PHP 3. call_user_func_array() /Applications/MAMP/htdocs/vhosts/fw/typo3_src/t3lib/class.t3lib_div.php:4813, referer: http://localhost/typo3/alt_doc.php?edit[pages]5407=edit&returnUrl=http%3A%2F%2Flocalhost%2Ftypo3%2Fsysext%2Fcms%2Flayout%2Fdb_layout.php
[Fri Sep 11 11:09:47 2009] [error] [client 127.0.0.1] PHP 4. t3lib_TCEforms_Suggest->processAjaxRequest() /Applications/MAMP/htdocs/vhosts/fw/typo3_src/t3lib/class.t3lib_div.php:0, referer: http://localhost/typo3/alt_doc.php?edit[pages]5407=edit&returnUrl=http%3A%2F%2Flocalhost%2Ftypo3%2Fsysext%2Fcms%2Flayout%2Fdb_layout.php
[Fri Sep 11 11:09:47 2009] [error] [client 127.0.0.1] PHP 5. t3lib_TCEforms_Suggest_DefaultReceiver->queryTable() /Applications/MAMP/htdocs/vhosts/fw/typo3_src/t3lib/tceforms/class.t3lib_tceforms_suggest.php:181, referer: http://localhost/typo3/alt_doc.php?edit[pages]5407=edit&returnUrl=http%3A%2F%2Flocalhost%2Ftypo3%2Fsysext%2Fcms%2Flayout%2Fdb_layout.php
[Fri Sep 11 11:09:47 2009] [error] [client 127.0.0.1] PHP 6. t3lib_TCEforms_Suggest_DefaultReceiver->queryTable() /Applications/MAMP/htdocs/vhosts/fw/typo3_src/t3lib/tceforms/class.t3lib_tceforms_suggest_defaultreceiver.php:218, referer: http://localhost/typo3/alt_doc.php?edit[pages]5407=edit&returnUrl=http%3A%2F%2Flocalhost%2Ftypo3%2Fsysext%2Fcms%2Flayout%2Fdb_layout.php
(issue imported from #M11925)
Files
Updated by Steffen Gebert about 15 years ago
Sorry.. small mistake:
If I change
$tmp = self::queryTable($this->params['value'], +$recursionCounter);
to
$tmp = self::queryTable($foo = $this->params['value'], +$recursionCounter);
everything works fine.
$recursionCounter has nothing to do with the problem. I only tried to move the ++ before the call.
Updated by Rupert Germann about 15 years ago
hi,
correct would be:
$tmp = self::queryTable($params, ++$recursionCounter);