Fixed compatibility issues with SilverStripe 3.1 (issue #19)

This commit is contained in:
Ed 2012-12-28 14:35:06 -04:00
parent aded1456f5
commit ff188ed1ec
2 changed files with 6 additions and 7 deletions

View File

@ -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

View File

@ -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) {