Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

ManyManyComplexTableField Changed in 2.3

Go to End

2 Posts   1896 Views


Community Member, 33 Posts

5 June 2009 at 12:53pm

I've upgraded a site that uses a ManyManyComplexTableField on a frontend form. It worked well in the past (2.2.1?) but now fails with an error:

Fatal error: Call to a member function Categories() on a non-object in C:\Program Files\xampp\htdocs\bigimage\sapphire\forms\HasManyComplexTableField.php on line 85

After some digging around it looks as though it relies on $this->form->getRecord() returning an object (without checking if it does), I tried to set the record to the dataobject being represented and got further errors from Form.php.

I'm not 100% sure on what its looking for and why so I'm not sure what to give it (if that makes any sense).

Has the process for using ManyManyComplexTableFields been changed or has it been broken?



Community Member, 33 Posts

8 June 2009 at 8:42am

Ok I think I've fixed it, AFTER the form has been constructed you need to call loadDataFrom($object) where object is the dataobject that the manymanycomplexttable field represents. It still doesn't seem to properly load the currently selected items, but that could be due to being in the middle of a multiform.