Skip to content

Commit

Permalink
Backport of #121
Browse files Browse the repository at this point in the history
  • Loading branch information
UndefinedOffset committed Jun 7, 2018
1 parent d616a78 commit 5c2ed5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

## [1.0.2](https://github.com/UndefinedOffset/SortableGridField/tree/1.0.2) (2018-06-07)
[Full Changelog](https://github.com/UndefinedOffset/SortableGridField/compare/1.0.1...1.0.2)

## [1.0.1](https://github.com/UndefinedOffset/SortableGridField/tree/1.0.1) (2018-03-01)
[Full Changelog](https://github.com/UndefinedOffset/SortableGridField/compare/1.0.0...1.0.1)

Expand Down
2 changes: 1 addition & 1 deletion code/forms/GridFieldSortableRows.php
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ protected function sortToPage(GridField $gridField, $data) {

$i = 1;
foreach ($items as $obj) {
if ($obj->ID == $targetItem->ID) {
if ($obj->ID == $targetItem->ID || $i >= count($sortPositions)) {
continue;
}

Expand Down

0 comments on commit 5c2ed5e

Please sign in to comment.