[TYPO3-core] RFC #11980: TCEforms suggest defaultreceiver returns array or boolean

Rupert Germann rupi at gmx.li
Mon Oct 19 16:31:57 CEST 2009


hi,

Steffen Gebert schrieb:
> Note:
> 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)).

yes, the 50 is needed for the mysql limit start, if we would change this 
we would also have to adapt the start calculation.

to simulate this i simply added these lines:

if ($recursionCounter) {
	$allRowsCount = 0;
}

directly after the line

$allRowsCount = $GLOBALS['TYPO3_DB']->sql_num_rows($res);

in function queryTable().

this resets $allRowsCount in the first recursive call.
To test this, you need a user which sees only a very few pages in a big 
tree with more than 50 results on a suggest search input.
If the first loop results in less than 10 results, the function calls 
itself again and then it tries to merge an array of rows with false.

while testing this I fould an easier solution for the problem: fix the 
error where it occurs.

see attached patch.

this is also a little performance improvement because checking a boolean 
is way faster than doing a count() call.

greets
rupert




More information about the TYPO3-team-core mailing list