mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX Gridfiled pagination missing after search (#10828)
This commit is contained in:
parent
fb7d2256f1
commit
bb5378e177
@ -186,7 +186,7 @@ class GridFieldFilterHeader extends AbstractGridFieldComponent implements GridFi
|
||||
|
||||
$dataListClone = clone($dataList);
|
||||
$results = $this->getSearchContext($gridField)
|
||||
->getQuery($filterArguments, false, false, $dataListClone);
|
||||
->getQuery($filterArguments, false, null, $dataListClone);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
@ -140,6 +140,7 @@ class SearchContext
|
||||
*/
|
||||
public function getQuery($searchParams, $sort = false, $limit = false, $existingQuery = null)
|
||||
{
|
||||
// @todo In CMS 6 change method param from `$limit = false` to `array|string|null $limit = null`
|
||||
$this->setSearchParams($searchParams);
|
||||
$query = $this->prepareQuery($sort, $limit, $existingQuery);
|
||||
return $this->search($query);
|
||||
@ -172,6 +173,9 @@ class SearchContext
|
||||
*/
|
||||
private function prepareQuery($sort, $limit, ?DataList $existingQuery): DataList
|
||||
{
|
||||
if ($limit === false) {
|
||||
$limit = null;
|
||||
}
|
||||
$query = null;
|
||||
if ($existingQuery) {
|
||||
if (!($existingQuery instanceof DataList)) {
|
||||
|
Loading…
Reference in New Issue
Block a user