I have a class Tip that extends Page, and TipHolder.
I have a class Author, Category and Province that all extend DataObject.
On Tip:
static $has_one = array(
'Photo' => 'Image',
'Province' => 'Province',
'Author' => 'Author'
);
static $many_many = array(
'Categories' => 'Category',
);
On Province and Author:
static $has_many = array(
'Tips' => 'Tip'
);
On Category:
static $belongs_many_many = array(
'Tips' => 'Tip'
);
Of course I have TipHolder... etc... but everything seems to work fine, except that when I save the Author and Province aren't saved with the rest of the data. My categories are though.
I'm using
$authorList = DataObject::get('Author');
$fields->addFieldToTab("Root.Content.Main", new DropdownField('Author', 'Auteur', $authorList->toDropDownMap()), 'Content');
... and about the same for Province...
in the getCMSFields function of Tips.
So I'm probably overlooking something stupid here.
Any ideas?