Release 2.45 (#5721)

Co-authored-by: Henning Klein <info@henningklein.de>
This commit is contained in:
Kevin Papst
2025-12-21 16:42:34 +01:00
committed by GitHub
parent 8c1ed68817
commit afb5a0bba4
67 changed files with 905 additions and 254 deletions

View File

@@ -17,7 +17,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormTypeInterface;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
abstract class BaseApiController extends AbstractController
{
@@ -85,8 +84,11 @@ abstract class BaseApiController extends AbstractController
$size = $all['size'];
if (is_numeric($size)) {
$size = (int) $size;
if ($size < 1 || $size > self::MAX_PAGE_SIZE) {
throw new BadRequestHttpException('Size must be between 1 and ' . self::MAX_PAGE_SIZE);
if ($size < 1) {
$size = BaseQuery::DEFAULT_PAGESIZE;
}
if ($size > self::MAX_PAGE_SIZE) {
$size = self::MAX_PAGE_SIZE;
}
$query->setPageSize($size);
}