Jump to:

3448 Posts in 1062 Topics by 738 members

Data Model Questions

SilverStripe Forums » Data Model Questions » I can't handle sub-URLs of a ModelAdmin_CollectionController object

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

Page: 1
Go to End
Author Topic: 2128 Views
  • zaralog
    Avatar
    Community Member
    2 Posts

    I can't handle sub-URLs of a ModelAdmin_CollectionController object Link to this post

    Hello silverstripe world!

    I have done thoses two class:

    class Exhibition extends DataObject
    {
    static $db = array('label' => 'Text');

    static $has_many = array('events' => 'Event');

    public function __construct()
    {
    parent::__construct();
    }
    }

    and :

    class Event extends DataObject
    {
    static $db = array(
    'start_date' => 'Date',
    'end_date' => 'Date'
    );

    static $has_one = array('exhibition' => 'Exhibition','country' => 'Country');
    static $has_many = array('business_date_countries' => 'BusinessDateCountry','event_towns' => 'EventTown');

    static $summary_fields = array(
    'start_date', 'end_date'
    );

    public function __construct()
    {
    parent::__construct();

    }
    }

    I can create records for exhibitions and events pretty well, but when i use the search listing option, the number of rows is correct but they are all empty ! and if i try to click over one of them i got a "BAD REQUEST" and " I can't handle sub-URLs of a ModelAdmin_CollectionController object" error messages;

    Is somebody could have an idea ?...

    Regards

  • zaralog
    Avatar
    Community Member
    2 Posts

    Re: I can't handle sub-URLs of a ModelAdmin_CollectionController object Link to this post

    I have found the answer :

    It was this portion of code that made troubles :

    public function __construct()
    {
    parent::__construct();

    }

    It's not needed so I cut it off and it's ok now.

    Regards

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