Hi UncleCheese,
I think I've found a bug as this code works for HasManyComplexTableField but not with HasManyDataObjectManager.
I'm using SS 2.4 and dataobject_manager trunk.
Code is:
class Ride extends Page {
static $has_many = array(
'Legs' => 'Leg'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Legs",
new HasManyDataObjectManager($this, 'Legs', 'Leg')
);
return $fields;
}
class Leg extends DataObject {
static $db = array(
'Description' => 'Text',
'Length' => 'Float'
);
static $has_one = array(
'Ride' => 'Ride',
'StartTown' => 'Town',
'EndTown' => 'Town'
);
static $summary_fields = array(
'StartTown.Title', 'EndTown.Title', 'Length', 'Description'
);
Seems to be ok in DOM if I remove $summary_fields.
Thanks!
[edit]
Error message is:
[Warning] strpos() expects parameter 1 to be string, array given
GET /mysite/admin/
Line 267 in /home/matweir/Workspace/mysite/sapphire/core/ViewableData.php
[/edit]