Hi folks,
I have got a wierd issue with a many_many relation. I have 2 Pages a ProjectHolder and a ServicePage. The ProjectHolder page has many_many relation the ServicePage. When I add the field to the CMSFields it will come up with a nice annoying error.
...... CASE WHEN "SiteTree"."ClassName" IS NOT NULL THEN "SiteTree"."ClassName" ELSE 'SiteTree' END ORDER BY "Sort" LIMIT 10 OFFSET 0 Column 'ProjectHolderID' in field list is ambiguous
here is my Projectholder
class ProjectHolder extends Page {
public static $many_many = array(
'Services'=>'ServicePage'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$tablefield = new ManyManyComplexTableField(
$this,
'Services',
'ServicePage',
null,
'getCMSFields_forPopup'
);
$fields->addFieldToTab("Root.Content.Services",$tablefield);
return $fields;
}
}
and here is my ServicePage
class ServicePage extends Page {
static $belongs_many_many = array(
'ProjectHolders' => 'ProjectHolder'
);
}
Does anyone have an idea as to what the issue could be ? Thx