Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » attn uncle cheese - dataObjectManager bug?

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2 3 4
Go to End
Author Topic: 4355 Views
  • Rawbit
    Avatar
    Community Member
    52 Posts

    attn uncle cheese - dataObjectManager bug? Link to this post

    UncleCheese et all:

    For some reason I can't get one of my dataobjectmanager to drag and drop. When I hit the checkbox, and hover over the items, it shows the cursor as if it wants to reorder - but they just stay stuck. All of the other dataObjectManager items on this site are sortable - just not this one!

    Any ideas what might be going on?

    I have this in _config.php:

    SortableDataObject::add_sortable_class('RelatedLink');

    And here is RelatedLink.php

    <?php
    class RelatedLink extends DataObject
    {
       static $db = array (
          'Title' => 'Text',
          'Address' => 'Text'
       );
       
       static $has_one = array (
          'Page' => 'Page'
       );
          
       public function getCMSFields_forPopup()
       {
          return new FieldSet(
             new TextField('Title'),
             new TextField('Address')
          );
       }
    }
    ?>

    And the part in Page.php

    $fields->addFieldToTab("Root.Content.RelatedLink", new DataObjectManager(
             $this,
             'RelatedLinks',
             'RelatedLink',
             array('Title' => 'Title','Address'=>'Address'),
             'getCMSFields_forPopup'
          ));

  • UncleCheese
    Avatar
    4085 Posts

    Re: attn uncle cheese - dataObjectManager bug? Link to this post

    Dude, I've got no idea. If you're getting the move cursor, it means the interface has refreshed properly and it has applied the sort controls. Weird that others are working. Have you tried different browsers? Any javascript errors?

  • klikhier
    Avatar
    Community Member
    150 Posts

    Re: attn uncle cheese - dataObjectManager bug? Link to this post

    G'day Uncle Cheese,

    Have the exact same issue here.

    _config.php

    ...
    SortableDataObject::add_sortable_classes(array('Characteristic','Reference','Photo'));
    ...

    Characteristic.php

    <?php

    class Characteristic extends DataObject
    {
       static $db = array (
          'Label' => 'Text',
          'Value' => 'Text'
       );
       
       static $has_one = array (
          'DesignDetailsPage' => 'DesignDetailsPage'
       );
       
       public function getCMSFields_forPopup()
       {
          return new FieldSet(
             new TextField('Label',"Label (example: 'Length over all')"),
             new TextField('Value',"Value (example: '45.50 m')")
          );
       }

    function PrincipalCharacteristics() {
    if ($this->iteratorPos < 4) {
    return true;
    }
    }

    }

    class Characteristic_Controller extends ContentController {
       
    }

    ?>

    DesignDetailsPage.php

    ...
    static $has_many = array(
    'Characteristics' => 'Characteristic',
    'References' => 'Reference',
    'Photos' => 'Photo'
    );
    ...
          $manager2 = new DataObjectManager(
             $this, // Controller
             'Characteristics', // Source name
             'Characteristic', // Source class
             array(
                'Label' => 'Label',
                'Value' => 'Value'
             ), // Headings
             'getCMSFields_forPopup' // Detail fields (function name or FieldSet object)
             // Filter clause
             // Sort clause
             // Join clause
          );

          $fields->addFieldToTab('Root.Content.Characteristics', $manager2);
    ...

    I'm sure this worked when I was developing the site, but currently (customer is already using CMS) drag&drop doesn't work anymore in none of the DOM-pages (in my case: Characteristics and Clients). Strange thing is that drag&drop does work on my ImageDOM (Photos). Tested in FF en IE7 and didn't work in both browsers.

    Installed modules: userforms, cmsworkflow, swfupload, dataobjectmanager. SS version 2.3.1.

  • klikhier
    Avatar
    Community Member
    150 Posts

    Re: attn uncle cheese - dataObjectManager bug? Link to this post

    Anything uncle cheese? I just cant' find out what's going wrong, but drag&drop is still not working... Pls help

  • UncleCheese
    Avatar
    4085 Posts

    Re: attn uncle cheese - dataObjectManager bug? Link to this post

    I can't replicate the issue, so it's really hard for me to troubleshoot. I have almost 20 production sites running DOM instances and none of them have ever reported this problem, so it's clearly an edge case. If you can figure out what causes it, please let me know and I'll test and fix, but with nothing to go on, I really can't sink time into investigating the problem.

    Edit: You are on the latest SVN, correct? And SS 2.3.2?

  • klikhier
    Avatar
    Community Member
    150 Posts

    Re: attn uncle cheese - dataObjectManager bug? Link to this post

    Thanks for your reply uncle cheese. Am not on latest svn and site has gone live with SS 2.3.1. Do you think getting the latest version of DOM could solve the issue? I'll go and try that later this week, thanks.

  • UncleCheese
    Avatar
    4085 Posts

    Re: attn uncle cheese - dataObjectManager bug? Link to this post

    Also, do you have more than one DOM instance on a page? e.g., on different tabs?

  • klikhier
    Avatar
    Community Member
    150 Posts

    Re: attn uncle cheese - dataObjectManager bug? Link to this post

    Yes, I have three different tabs. Two normal DOMs and one ImageDOM.

    4355 Views
Page: 1 2 3 4
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.