Permalink
Browse files

Fixed compatibility issues with SilverStripe 3.1 (issue #19)

  • Loading branch information...
1 parent aded145 commit ff188ed1eceed891c3b04116a640a68ac9ff5eb8 @UndefinedOffset committed Dec 28, 2012
Showing with 6 additions and 7 deletions.
  1. +2 −6 README.md
  2. +4 −1 code/forms/GridFieldSortableRows.php
View
@@ -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
@@ -115,7 +115,10 @@ public function getManipulatedData(GridField $gridField, SS_List $dataList) {
*/
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) {

0 comments on commit ff188ed

Please sign in to comment.