diff --git a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php index 61c4afb83e60..f9441eeba71f 100644 --- a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php +++ b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php @@ -6084,8 +6084,12 @@ public function getQuery($table, $conf, $returnQueryArray = false) try { $count = $countQueryBuilder->executeQuery()->fetchOne(); - $conf['max'] = str_ireplace('total', $count, $conf['max']); - $conf['begin'] = str_ireplace('total', $count, $conf['begin']); + if (isset($conf['max'])) { + $conf['max'] = str_ireplace('total', $count, (string)$conf['max']); + } + if (isset($conf['begin'])) { + $conf['begin'] = str_ireplace('total', $count, (string)$conf['begin']); + } } catch (DBALException $e) { $this->getTimeTracker()->setTSlogMessage($e->getPrevious()->getMessage()); $error = true; @@ -6093,12 +6097,14 @@ public function getQuery($table, $conf, $returnQueryArray = false) } 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) { + if (isset($conf['begin']) && $conf['begin'] > 0) { + $conf['begin'] = MathUtility::forceIntegerInRange((int)ceil($this->calc($conf['begin'])), 0); $queryBuilder->setFirstResult($conf['begin']); } - $queryBuilder->setMaxResults($conf['max'] ?: 100000); + if (isset($conf['max'])) { + $conf['max'] = MathUtility::forceIntegerInRange((int)ceil($this->calc($conf['max'])), 0); + $queryBuilder->setMaxResults($conf['max'] ?: 100000); + } } }