Skip to content

Commit

Permalink
FIX Ensure selected page size is retained when deleting records
Browse files Browse the repository at this point in the history
  • Loading branch information
robbieaverill committed Aug 1, 2017
1 parent f0d2ec7 commit 403900f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions code/GridFieldConfigurablePaginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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
Expand Down

0 comments on commit 403900f

Please sign in to comment.