mirror of
https://github.com/UndefinedOffset/SortableGridField.git
synced 2024-10-22 17:05:38 +02:00
Fixes fixSortColumn's Random Inital Sorting
When loading a GridField with several new items without a sort order (e.g. after uploading 10 images via GridFieldBulkEditingTools), it would previously apply a seemingly random order to them. This fix ensures that the order applied is the same order as the items were created (or uploaded) in.
This commit is contained in:
parent
81886ed81a
commit
e493231556
@ -153,7 +153,7 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
|
||||
|
||||
|
||||
$max = $list->Max($this->sortColumn);
|
||||
$list=$list->filter($this->sortColumn, 0);
|
||||
$list=$list->filter($this->sortColumn, 0)->sort("Created,ID");
|
||||
if($list->Count()>0) {
|
||||
$owner = $gridField->Form->getRecord();
|
||||
$sortColumn = $this->sortColumn;
|
||||
|
Loading…
Reference in New Issue
Block a user