Project

General

Profile

Bug #21074 » 11979.diff

Administrator Admin, 2009-09-16 21:03

View differences:

t3lib/tceforms/class.t3lib_tceforms_suggest_defaultreceiver.php (working copy)
$rows = array();
$this->params = &$params;
$this->start = $this->recursionCounter * 50;
// we fetch an exponentially growing number of records
$start = 50 * (pow(2, $recursionCounter) - 1);
$limit = 50 * pow(2, $recursionCounter);
$this->prepareSelectStatement();
$this->prepareOrderByStatement();
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
......
$this->selectClause,
'',
$this->orderByStatement,
$this->start . ', 50');
$start . ', ' . $limit);
$allRowsCount = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
......
$GLOBALS['TYPO3_DB']->sql_free_result($res);
// if there are less records than we need, call this function again to get more records
if (count($rows) < $this->maxItems &&
$allRowsCount >= 50 && $recursionCounter < $this->maxItems) {
if (count($rows) < $this->maxItems && $allRowsCount >= $limit) {
$tmp = self::queryTable($params, ++$recursionCounter);
$rows = array_merge($tmp, $rows);
}
(1-1/2)