Hi there,
This is my first foray into the dataobjectmanager and I'm having a little trouble. I have a working $many_many $belongs_many_many relationship going and I have a ManyManyComplexTableField to manage the relationship.
It works well but I'm keen to get the filter/search features of the DOM.
So started out replacing this:
function getCMSFields() {
$fields = parent::getCMSFields();
$tablefield = new ManyManyComplexTableField (
$this,
'Bills',
'Bill',
array(
'Type' => 'Type',
'Total' => 'Total',
'Date' => 'Date',
),
'getCMSFields_forPopup'
);
$tablefield->setAddTitle( 'A Bill' );
$fields->addFieldToTab( 'Root.Content.Bills', $tablefield );
return $fields;
}
with this:
function getCMSFields() {
$fields = parent::getCMSFields();
$tablefield = new ManyManyDataObjectManager (
$this,
'Bills',
'Bill',
array(
'Type' => 'Type',
'Total' => 'Total',
'Date' => 'Date',
),
'getCMSFields_forPopup'
);
$tablefield->setAddTitle( 'A Bill' );
$fields->addFieldToTab( 'Root.Content.Bills', $tablefield );
return $fields;
}
but I get an error when accessing the cms that I think is about a missing 'IF' argument but can't quite tell:
[User Error] Couldn't run query: SELECT "Bill"."ClassName", "Bill"."Created", "Bill"."LastEdited", "Bill"."Total", "Bill"."Type", "Bill"."Date", "Bill"."ID", CASE WHEN "Bill"."ClassName" IS NOT NULL THEN "Bill"."ClassName" ELSE 'Bill' END AS "RecordClassName", IF(`Flatmate_Bills`.`FlatmateID` IS NULL, '0', '1') AS Checked FROM "Bill" LEFT JOIN `Flatmate_Bills` ON (`Bill`.`ID` = `BillID` AND `Flatmate_Bills`.`FlatmateID` = '5') GROUP BY "Bill"."ClassName", "Bill"."Created", "Bill"."LastEdited", "Bill"."Total", "Bill"."Type", "Bill"."Date", "Bill"."ID", CASE WHEN "Bill"."ClassName" IS NOT NULL THEN "Bill"."ClassName" ELSE 'Bill' END LIMIT 0, 10 | no such function: IF
It would be great to get a little insight as to where i'm going wrong!
thanks
Bernie