Merge 04c49653a6
into 09af046dc5
This commit is contained in:
commit
3f459807c1
|
@ -230,15 +230,15 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
|
|||
|
||||
|
||||
//@TODO Need to optimize this to eliminate some of the resource load could use raw queries to be more efficient
|
||||
$data['Items'] = explode(',', $data['Items']);
|
||||
for($sort = 0;$sort<count($data['Items']);$sort++) {
|
||||
$id = intval($data['Items'][$sort]);
|
||||
$ids = explode(',', $data['ItemIDs']);
|
||||
for($sort = 0;$sort<count($ids);$sort++) {
|
||||
$id = intval($ids[$sort]);
|
||||
if ($many_many) {
|
||||
DB::query('UPDATE "' . $table
|
||||
. '" SET "' . $sortColumn.'" = ' . (($sort + 1) + $pageOffset)
|
||||
. ' WHERE "' . $componentField . '" = ' . $id . ' AND "' . $parentField . '" = ' . $owner->ID);
|
||||
} else {
|
||||
$obj = $items->byID($data['Items'][$sort]);
|
||||
$obj = $items->byID($ids[$sort]);
|
||||
$obj->$sortColumn = ($sort + 1) + $pageOffset;
|
||||
$obj->write();
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
value: button.val()
|
||||
},
|
||||
{
|
||||
name: 'Items',
|
||||
name: 'ItemIDs',
|
||||
value: dataRows
|
||||
}
|
||||
]});
|
||||
|
|
Loading…
Reference in New Issue