From fbf7b864d574a3688f7267765223ab80278c7e82 Mon Sep 17 00:00:00 2001 From: "johannes.hammersen" Date: Sat, 21 Sep 2024 16:58:17 +0200 Subject: [PATCH] FIX #355 Sorting in pageinated lists If a many_many relation with the sort in an many_many_extraField has an item draged to another page the resulting sort is wrong. This was caused by the handleMoveToPage function not respecting the original sort of the list. --- src/GridFieldOrderableRows.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GridFieldOrderableRows.php b/src/GridFieldOrderableRows.php index a7b650f..005e601 100755 --- a/src/GridFieldOrderableRows.php +++ b/src/GridFieldOrderableRows.php @@ -500,7 +500,7 @@ public function handleMoveToPage(GridField $grid, $request) $move = $request->postVar('move'); $field = $this->getSortField(); - $list = $grid->getList(); + $list = $grid->getList()->sort($field); $manip = $grid->getManipulatedList(); $existing = $manip->map('ID', $field)->toArray();