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.

Data Model Questions /

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


Reply


2 Posts   2150 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