Jump to:

7939 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » add_sortable_classes not having any effect

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2
Go to End
Author Topic: 2085 Views
  • dizzystuff
    Avatar
    Community Member
    93 Posts

    add_sortable_classes not having any effect Link to this post

    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'));

  • dizzystuff
    Avatar
    Community Member
    93 Posts

    Re: add_sortable_classes not having any effect Link to this post

    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.

  • UncleCheese
    Avatar
    4085 Posts

    Re: add_sortable_classes not having any effect Link to this post

    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.

  • dizzystuff
    Avatar
    Community Member
    93 Posts

    Re: add_sortable_classes not having any effect Link to this post

    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.

  • UncleCheese
    Avatar
    4085 Posts

    Re: add_sortable_classes not having any effect Link to this post

    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

  • dizzystuff
    Avatar
    Community Member
    93 Posts

    Re: add_sortable_classes not having any effect Link to this post

    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!!

  • Quarx
    Avatar
    Community Member
    12 Posts

    Re: add_sortable_classes not having any effect Link to this post

    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...

  • UncleCheese
    Avatar
    4085 Posts

    Re: add_sortable_classes not having any effect Link to this post

    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?

    2085 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.