Backport of #121

This commit is contained in:
UndefinedOffset 2018-06-07 09:54:56 -03:00
parent d616a783c6
commit 5c2ed5ecd0
2 changed files with 4 additions and 1 deletions

View File

@ -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)

View File

@ -598,7 +598,7 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
$i = 1;
foreach ($items as $obj) {
if ($obj->ID == $targetItem->ID) {
if ($obj->ID == $targetItem->ID || $i >= count($sortPositions)) {
continue;
}