mirror of
https://github.com/UndefinedOffset/SortableGridField.git
synced 2024-10-22 17:05:38 +02:00
Fixes "undefined offset" error when moving a many_many item to previous page (#121)
When viewing the last page of a list of data objects, trying to move one of them to the previous page triggers an "undefined offset" error.
This commit is contained in:
parent
5e3e5cac3f
commit
118838fb79
@ -656,7 +656,7 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
|
|||||||
|
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach ($items as $obj) {
|
foreach ($items as $obj) {
|
||||||
if ($obj->ID == $targetItem->ID) {
|
if ($obj->ID == $targetItem->ID || $i >= count($sortPositions)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user