fix: [index pagination] caps the index at 100 elements

dependabot/npm_and_yarn/webroot/theme/braces-3.0.3
iglocska 2024-05-15 11:32:23 +02:00
parent 30fb9b0c14
commit 18b322400a
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 3 additions and 1 deletions

View File

@ -112,6 +112,7 @@ class CRUDComponent extends Component
if (!$this->Controller->ParamHandler->isRest()) { if (!$this->Controller->ParamHandler->isRest()) {
$this->setRequestedEntryAmount(); $this->setRequestedEntryAmount();
} else if (empty($this->request->getQuery('limit'))) { } 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 $this->Controller->paginate['limit'] = PHP_INT_MAX; // Make sure to download the entire filtered table
} }
$data = $this->Controller->paginate($query, $this->Controller->paginate ?? []); $data = $this->Controller->paginate($query, $this->Controller->paginate ?? []);
@ -924,9 +925,10 @@ class CRUDComponent extends Component
$tableSettings = IndexSetting::getTableSetting($user, $this->Table); $tableSettings = IndexSetting::getTableSetting($user, $this->Table);
if (!empty($tableSettings['number_of_element'])) { if (!empty($tableSettings['number_of_element'])) {
if ($tableSettings['number_of_element'] === 'all') { 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['limit'] = intval($tableSettings['number_of_element']);
$this->Controller->paginate['maxLimit'] = $this->Controller->paginate['limit'];
} }
} }