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); }