Sort order is now always fixed even if drag and drop toggle is not on

This commit is contained in:
UndefinedOffset 2012-08-10 12:50:14 -03:00
parent 2bf027e5f0
commit 0beef798a0

View File

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