Project

General

Profile

Bug #100857 ยป ContentObjectRenderer.patch

David Bruchmann, 2023-05-11 05:53

View differences:

Classes/ContentObject/ContentObjectRenderer.php 2023-05-11 11:34:02.945969769 +0700
try {
$count = $countQueryBuilder->executeQuery()->fetchOne();
$conf['max'] = str_ireplace('total', $count, $conf['max']);
$conf['begin'] = str_ireplace('total', $count, $conf['begin']);
if (array_key_exists('max', $conf)) {
$conf['max'] = str_ireplace('total', $count, $conf['max']);
}
if (array_key_exists('begin', $conf)) {
$conf['begin'] = str_ireplace('total', $count, $conf['begin']);
}
} catch (DBALException $e) {
$this->getTimeTracker()->setTSlogMessage($e->getPrevious()->getMessage());
$error = true;
......
}
if (!$error) {
$conf['begin'] = MathUtility::forceIntegerInRange((int)ceil($this->calc($conf['begin'] ?? '')), 0);
$conf['max'] = MathUtility::forceIntegerInRange((int)ceil($this->calc($conf['max'] ?? '')), 0);
if ($conf['begin'] > 0) {
$queryBuilder->setFirstResult($conf['begin']);
if (array_key_exists('begin', $conf)) {
$conf['begin'] = MathUtility::forceIntegerInRange((int)ceil($this->calc($conf['begin'] ?? '')), 0);
if ($conf['begin'] > 0) {
$queryBuilder->setFirstResult($conf['begin']);
}
}
if (array_key_exists('max', $conf)) {
$conf['max'] = MathUtility::forceIntegerInRange((int)ceil($this->calc($conf['max'] ?? '')), 0);
$queryBuilder->setMaxResults($conf['max'] ?: 100000);
}
$queryBuilder->setMaxResults($conf['max'] ?: 100000);
}
}
    (1-1/1)