Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

add_sortable_classes not having any effect


Go to End
Reply

15 Posts   2115 Views

Avatar
dizzystuff

27 February 2010 at 3:52pm Community Member, 93 Posts

Hi Guys

I'm upgrading one of my client sites from 2.3.2 to 2.3.6 and while I have sortable classes declared in my _config.php, the ManyManyDataObjectManagers that I have in the CMS no longer display "Allow drag & drop reordering" checkbox in the bottom left, rather just a "Show related records" checkbox instead.

I can see in the template a check for <% if Sortable %> but it appears to not eval to true - hence my missing checkbox.

This was one of the issues I was also having with implementing DOM in a 2.4b site, which until now I had written off to 2.4 incompatibility. For this site though it has been a straight upgrade from 2.3.2 to 2.3.6, I've not changed a line of any of my code.

I've given the forums a good once/twice over but couldn't find threads dealing with a similar issue. Please help!

FYI the snippet from _config.php looks like this:

SortableDataObject::add_sortable_classes(array('PodItem','FeatureItem','TeamMember'));

Avatar
dizzystuff

27 February 2010 at 5:21pm Community Member, 93 Posts

Ah. Bugger. I just realised I did upgrade DOM too. The download of DOM I'm having this issue with is the current download on the modules page, r374.

Avatar
UncleCheese

27 February 2010 at 5:59pm 4085 Posts

The demo site http://dataobjectmanager.carlinowebdesign.com is always running the latest DOM on the latest version of SS. I'm not seeing the issue there.

Avatar
dizzystuff

27 February 2010 at 6:13pm Community Member, 93 Posts

Dang.

Should the 'New MMFDOMTest', 'Random' or 'Glossary' pages ManyManyDOMs have sorting? If so, they're not showing, for me at least, I can attach sshots.. If not, would you mind adding one of them to the sortable classes? I can see it working on the Image Gallery though.

Avatar
UncleCheese

28 February 2010 at 3:03am 4085 Posts

Oh, I hadn't noticed you were using an MMDOM. The many_many sorting will not be available until 2.4. It worked in 2.3.3, but then changes to Object.php broke it. See ticket here:

http://open.silverstripe.org/ticket/4929

Avatar
dizzystuff

1 March 2010 at 4:57pm Community Member, 93 Posts

Ah - righteo then. Thanks for getting back to me UC. Looks like I'm really looking forward to / hanging out for 2.4 and it's associated DOM update!!

Avatar
Quarx

15 April 2010 at 12:41pm Community Member, 12 Posts

Any news about the fix for this bug?
I think I'm experiencing the same problem with ss2.4rc1 and the trunk version of DOM.

With the older ss (2.3.5) and DOM, I was able to use simple add_sortable_class in order to allow a user to drag&drop with ManyManyDataObjectManager. Now as I see, there's a new feature add_sortable_many_many_relation which works fine, but it's not what I need. With add_sortable_class I was able to make one sorting order for my DataObject items, referenced in all Pages allowing to select from those items (sorry for the lack of terminology but I'm still not used to SS names).

Sorting with drag&drop was quite useful feature, now my users have to manually set up SortOrder for each item...

Avatar
UncleCheese

15 April 2010 at 12:51pm 4085 Posts

I'm not aware of this bug. You're saying standard (non-many_many) sortable objects are not sorting? Does the drag and drop appear and does it work? Or is it just not updating the record in the database?

Go to Top