From 18b322400a46d87e18e3b98b15a1632616e84feb Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 15 May 2024 11:32:23 +0200 Subject: [PATCH] fix: [index pagination] caps the index at 100 elements --- src/Controller/Component/CRUDComponent.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Controller/Component/CRUDComponent.php b/src/Controller/Component/CRUDComponent.php index da00194..e6d6f6c 100644 --- a/src/Controller/Component/CRUDComponent.php +++ b/src/Controller/Component/CRUDComponent.php @@ -112,6 +112,7 @@ class CRUDComponent extends Component if (!$this->Controller->ParamHandler->isRest()) { $this->setRequestedEntryAmount(); } else if (empty($this->request->getQuery('limit'))) { + $this->Controller->paginate['maxLimit'] = PHP_INT_MAX; $this->Controller->paginate['limit'] = PHP_INT_MAX; // Make sure to download the entire filtered table } $data = $this->Controller->paginate($query, $this->Controller->paginate ?? []); @@ -924,9 +925,10 @@ class CRUDComponent extends Component $tableSettings = IndexSetting::getTableSetting($user, $this->Table); if (!empty($tableSettings['number_of_element'])) { if ($tableSettings['number_of_element'] === 'all') { - $tableSettings['number_of_element'] = 10000; // Even with all selecect, make sure not to return too much data for the browser + $tableSettings['number_of_element'] = 10000; // Even with all selected, make sure not to return too much data for the browser } $this->Controller->paginate['limit'] = intval($tableSettings['number_of_element']); + $this->Controller->paginate['maxLimit'] = $this->Controller->paginate['limit']; } }