Skip to content

Commit

Permalink
Merge pull request #143 from tony13tv/patch-1
Browse files Browse the repository at this point in the history
Fix on getPreviousRecordID
  • Loading branch information
Aaron Carlino committed Aug 24, 2016
2 parents 1125af0 + 170479e commit a7260e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/extensions/GridFieldBetterButtonsItemRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,9 +504,9 @@ protected function saveAndRedirect($data, $form, $redirectLink) {
* @return int
*/
public function getPreviousRecordID() {
$map = $this->owner->gridField->getManipulatedList()->column('ID');
$map = $this->owner->gridField->getManipulatedList()->limit(PHP_INT_MAX, 0)->column('ID');
$offset = array_search($this->owner->record->ID, $map);
return ($offset > 0) ? $map[$offset-1] : false;
return isset($map[$offset-1]) ? $map[$offset-1] : false;
}


Expand Down

0 comments on commit a7260e6

Please sign in to comment.