diff --git a/code/GridFieldConfigurablePaginator.php b/code/GridFieldConfigurablePaginator.php index 817685c3..c147e09f 100644 --- a/code/GridFieldConfigurablePaginator.php +++ b/code/GridFieldConfigurablePaginator.php @@ -236,6 +236,12 @@ public function getManipulatedData(GridField $gridField, SS_List $dataList) // Assign the GridField to the class so it can be used later in the request $this->setGridField($gridField); + // Retain page sizes during actions provided by other components + $state = $this->getGridPagerState(); + if (is_numeric($state->pageSize)) { + $this->setItemsPerPage($state->pageSize); + } + if (!($dataList instanceof SS_Limitable) || ($dataList instanceof UnsavedRelationList)) { return $dataList; } @@ -254,6 +260,9 @@ public function getManipulatedData(GridField $gridField, SS_List $dataList) public function getTemplateParameters(GridField $gridField) { $state = $this->getGridPagerState(); + if (is_numeric($state->pageSize)) { + $this->setItemsPerPage($state->pageSize); + } $arguments = $this->getPagerArguments(); // Figure out which page and record range we're on