Bug #21075
closedTCEforms suggest defaultreceiver returns array or boolean
0%
Description
To fetch additional records, the following code is executed in queryTable():
$tmp = self::queryTable($params, ++$recursionCounter);
$rows = array_merge($tmp, $rows);
Unfortunately queryTable() returns false, if no records are found and so array_merge() fails.
This happens (I think), if exactly a multiple of 50 possible results exist and so queryTable() is called again, to fetch more records (as $allRowsCount >= 50 is checked (and not > 50, but this has to stay I think)).
So instead of returning FALSE, better return an empty array().
[Wed Sep 16 18:26:29 2009] [error] [client ::1] PHP Warning: array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #1 is not an array in /Applications/MAMP/htdocs/vhosts/fw/typo3_src/t3lib/tceforms/class.t3lib_tceforms_suggest_defaultreceiver.php on line 220, referer: http://localhost/typo3/alt_doc.php?edit[pages]5407=edit&returnUrl=http%3A%2F%2Flocalhost%2Ftypo3%2Fsysext%2Fcms%2Flayout%2Fdb_layout.php
[Wed Sep 16 18:26:29 2009] [error] [client ::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
[Wed Sep 16 18:26:29 2009] [error] [client ::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
[Wed Sep 16 18:26:29 2009] [error] [client ::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
[Wed Sep 16 18:26:29 2009] [error] [client ::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
[Wed Sep 16 18:26:29 2009] [error] [client ::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
[Wed Sep 16 18:26:29 2009] [error] [client ::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
[Wed Sep 16 18:26:29 2009] [error] [client ::1] PHP 6. array_merge() /Applications/MAMP/htdocs/vhosts/fw/typo3_src/t3lib/tceforms/class.t3lib_tceforms_suggest_defaultreceiver.php:220, 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 #M11980)
Files