Jump to:

7938 Posts in 1541 Topics by 945 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Sortable Data Object Not Working?

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 1208 Views
  • DanStephenson
    Avatar
    Community Member
    115 Posts

    Sortable Data Object Not Working? Link to this post

    I am trying to make my dataobject called Models sortable. When I add the following code to my _config.php file:

    SortableDataObject::add_sortable_class('Model');

    Then I do a /dev/build/, I am taken to an admin login where I put in the username and password, but it never lets me login. Any idea what could be wrong?

  • DanStephenson
    Avatar
    Community Member
    115 Posts

    Re: Sortable Data Object Not Working? Link to this post

    I am now getting an error message that there is a problem with the output at Line 1 of Model.php. I've pasted my code below, if anyone can see what's wrong.

    <?php
    class Model extends DataObject {
       static $db = array (
          'ModelName' => 'Text',
          'ModelLink' => 'Text'
       );
       
       static $has_one = array (
          'BrandPage' => 'BrandPage'
       );
       
       public function getCMSFields_forPopup()
       {
          return new FieldSet(
             new TextField('ModelName'),
             new TextField('ModelLink')
          );
       }
       
       function Second(){
          return $this->iteratorPos % 2;
       }
    }
    ?>

  • UncleCheese
    Avatar
    4085 Posts

    Re: Sortable Data Object Not Working? Link to this post

    This is just a guess, but I'll bet Model is a reserved classname.

    1208 Views
Page: 1
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.