Found a bug in sorting order of dataobject displayed in the CMS - DOM view. (List View)
- Any DataObjectManager with minimal configuration (one text field).
- At least 2 dataobjects items added.
- Enabled - SortableDataObject::add_sortable_class('YourSortedClass'); in _config.php.
- Default ordering configuration is -- Ascending
- Click any of the items in the list, so popup window will appear.
- Close it right after. (no save needed)
- After refresh the items are in reverse order -- Descending
The order will be ok again after reloading the page in cms, but after opening the popup again, will change as before.
Revisions // Where to fix.
This bug was introduced in r419 - in DataObjectManager.php..
In the current revision r432 is on line '246' - in DataObjectManager.php
To fix it - REMOVE
on line 246.
- When trying to define the Sorting order in _config.php with SortableDataObject::set_sort_dir("ASC");
or DESC .. it wont change anything
- Not sure if the removed part is important in other parts of the code..
UncleCheese can you review the code, thanks also for the great work.
-- to see more cleary changes of the order add SortOrder values from the db to the view
public function getCMSFields()
$f = parent::getCMSFields();
$manager = new DataObjectManager(
$this, // Controller
'GalleryImages', // Source name
'GalleryImage', // Source class
'SortOrder' => 'Order',
'Title' => 'Názov'