diff --git a/README.md b/README.md index 93a60d1..a961869 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ SortableGridField ================= -Adds drag and drop functionality to SilverStripe 3.0's GridField +Adds drag and drop functionality to SilverStripe 3's GridField ## Requirements -* SilverStripe 3.0.x +* SilverStripe 3.x ## Installation * Download the module from here https://github.com/UndefinedOffset/SortableGridField/downloads @@ -42,9 +42,5 @@ SortableGridField is not the same as SortableDataObject, since it is only a comp UPDATE YourTable SET SortOrder=SortOrder+1; ``` -## SilverStripe 3.1 Notice -SortableGridField is not compatable or atleast not guarenteed to work on 3.1, I've been getting reports that there are issues at this time. - ## @TODO * Optimize re-ordering of a has_many relationship when sorting on a single page -* SilverStripe 3.1 compatability diff --git a/code/forms/GridFieldSortableRows.php b/code/forms/GridFieldSortableRows.php index 7d4e0b9..2e53c79 100644 --- a/code/forms/GridFieldSortableRows.php +++ b/code/forms/GridFieldSortableRows.php @@ -115,7 +115,10 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP */ protected function fixSortColumn($gridField, SS_List $dataList) { $list=clone $dataList; - $list->dataQuery()->limit(array()); + $list=$list->alterDataQuery(function($query, SS_List $tmplist) { + $query->limit(array()); + return $query + }); $many_many = ($list instanceof ManyManyList); if (!$many_many) {