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:

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

ManyManyDataObjectManager popup form add to current object

Go to End

2 Posts   1076 Views


Community Member, 28 Posts

7 August 2012 at 10:30pm

I have a many_many (Event -> Images (DataObject with additional Fields) relation and using the ManyManyDataObjectManager to manage it.

My Scenario:
I go through the ModalAdmin and set up my new Event.
In the DataObjectManager I add a new image (through the popup-form) that is then created but not attached to the current event.
Is there any option to catch the current EventID in the popupform and add it automagically?

thanks guys!


Community Member, 66 Posts

25 August 2012 at 1:32am

Edited: 25/08/2012 1:32am

Have you included

 	static $has_one = array (
		'Photo' => 'Image'

in Event? It should automatically add the ID from the photo to the Event table.