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

Manage Object with multiple images with IDOM


Go to End


2 Posts   1467 Views

Avatar
micahsheets

Community Member, 165 Posts

20 June 2011 at 5:12pm

Edited: 20/06/2011 5:17pm

I have done this in the past with other versions of SS and DOM but for some reason SS2.4.5 and most current DOM won't work for me.

I have a DataObject that has a full size image and two other thumbnails attached as $has_one relationships. IDOM is used to add the full size image and after the image upload I am presented with the usual interface to further edit the DataObject. Now in this interface I have two ImageFields to upload the two thumbnails. However when I try to attach the thumbnail images I get an error

The code line in question is $this->form->getRecord()->write();

I do now know which record getRecord() refers to here. But I assume that it is not getting the DataObject that it is supposed to attach the image to. If I look at the database I do see that the DataObject is there and is correct.

If I just hit save without attaching the thumbnails and then click on the image in IDOM I can then use the interface normally to add the thumbnails without getting the error.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

21 June 2011 at 4:38am

Have you tried just using Uploadify fields for those?

--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com