From 0beef798a0cceb0e09dc6713f6507894c69466dd Mon Sep 17 00:00:00 2001 From: UndefinedOffset Date: Fri, 10 Aug 2012 12:50:14 -0300 Subject: [PATCH] Sort order is now always fixed even if drag and drop toggle is not on --- code/forms/GridFieldSortableRows.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/forms/GridFieldSortableRows.php b/code/forms/GridFieldSortableRows.php index 62481c6..ce45b99 100644 --- a/code/forms/GridFieldSortableRows.php +++ b/code/forms/GridFieldSortableRows.php @@ -89,6 +89,10 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP * @return DataList Modified Data List */ public function getManipulatedData(GridField $gridField, SS_List $dataList) { + //Detect and correct items with a sort column value of 0 (push to bottom) + $this->fixSortColumn($gridField, $dataList); + + $headerState = $gridField->State->GridFieldSortableHeader; $state = $gridField->State->GridFieldSortableRows; if ((!is_bool($state->sortableToggle) || $state->sortableToggle==false) && $headerState && !empty($headerState->SortColumn)) { @@ -101,10 +105,6 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP } - //Detect and correct items with a sort column value of 0 (push to bottom) - $this->fixSortColumn($gridField, $dataList); - - return $dataList->sort($this->sortColumn); }