mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00: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);
|
$dataListClone = clone($dataList);
|
||||||
$results = $this->getSearchContext($gridField)
|
$results = $this->getSearchContext($gridField)
|
||||||
->getQuery($filterArguments, false, false, $dataListClone);
|
->getQuery($filterArguments, false, null, $dataListClone);
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
@ -140,6 +140,7 @@ class SearchContext
|
|||||||
*/
|
*/
|
||||||
public function getQuery($searchParams, $sort = false, $limit = false, $existingQuery = null)
|
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);
|
$this->setSearchParams($searchParams);
|
||||||
$query = $this->prepareQuery($sort, $limit, $existingQuery);
|
$query = $this->prepareQuery($sort, $limit, $existingQuery);
|
||||||
return $this->search($query);
|
return $this->search($query);
|
||||||
@ -172,6 +173,9 @@ class SearchContext
|
|||||||
*/
|
*/
|
||||||
private function prepareQuery($sort, $limit, ?DataList $existingQuery): DataList
|
private function prepareQuery($sort, $limit, ?DataList $existingQuery): DataList
|
||||||
{
|
{
|
||||||
|
if ($limit === false) {
|
||||||
|
$limit = null;
|
||||||
|
}
|
||||||
$query = null;
|
$query = null;
|
||||||
if ($existingQuery) {
|
if ($existingQuery) {
|
||||||
if (!($existingQuery instanceof DataList)) {
|
if (!($existingQuery instanceof DataList)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user