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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

add_sortable_classes not having any effect


Go to End


15 Posts   3474 Views

Avatar
dizzystuff

Community Member, 94 Posts

27 February 2010 at 3:52pm

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

Community Member, 94 Posts

27 February 2010 at 5:21pm

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

Forum Moderator, 4102 Posts

27 February 2010 at 5:59pm

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

Community Member, 94 Posts

27 February 2010 at 6:13pm

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

Forum Moderator, 4102 Posts

28 February 2010 at 3:03am

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

Community Member, 94 Posts

1 March 2010 at 4:57pm

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

Community Member, 12 Posts

15 April 2010 at 12:41pm

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

Forum Moderator, 4102 Posts

15 April 2010 at 12:51pm

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