Hello.
I am currently trying to manage many to many relationships in the CMS and I have run into some issues.
Everything works on the page that is on the many_many-side but I am getting strange behaviour from the page that is on the belongs_many_many-side. At first everything worked by using checkboxsetfield like this
$accessoryList = DataObject::get('AccessoryPage');
if ($accessoryList) {
$fields->addFieldToTab('Root.Content.Accessories', new CheckboxSetField('Accessories', 'Related Accessories', $accessoryList));
}
But when I added a boolean field on the many-many page, suddenly the belongs_many_many-page checkboxsetfield is showing which pages have the boolean set to 1, not the relationship. Also trying to save the page now yields an error and it worked before I added the boolean field.
I have also tried using the ManyManyComplexTableField and the manymany version of dataobjectmanager for this but if it's used on the belongs_many_many-side I get an empty javascript alert-box and then simply "Error loading the page".
Neither of these feels like expected behaviour to me. I would really like to be able to manage the relationship from both ends and right now that seems to be impossible. Is this the way it's supposed to be?
Kindly, Marcus