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.

Data Model Questions /

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

I can't handle sub-URLs of a ModelAdmin_CollectionController object


Go to End


2 Posts   3672 Views

Avatar
zaralog

Community Member, 2 Posts

23 January 2009 at 5:52am

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

Avatar
zaralog

Community Member, 2 Posts

24 January 2009 at 5:44am

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