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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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   1562 Views

Avatar
joern

Community Member, 28 Posts

7 August 2012 at 10:30pm

Hi,
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!

Avatar
Stef87

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.