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.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Preview: DataObjectManager module


Reply

379 Posts   61737 Views

Avatar
henning.blunck

14 April 2009 at 12:37am Community Member, 6 Posts

Hey,
seems like, at the moment, the dataobjectmanager is the best (and sometimes only) way to work properly on many_many-Relationships. My question (and I hope it is not that dumb that anyone notices, I'm a relative newbee) is:
Does the DataObjectManager also works with many_many_extraFields? How can these additional attributes to the connecting table be displayed/altered/etc. And despite from that: Is there an other chance to edit these fields? I've found this feature of extraFields nice and important but very few documented.

Bye for now,

Henning

Avatar
UncleCheese

14 April 2009 at 1:29am 4085 Posts

@sunnyboy -- I've attached a working example of a Resume upload form that is in use on a production site with the latest SWFUpload module. Let me know if there's anything that needs to be updated in the docs.

@amir -- I like the idea. I'll add a $canUpload parameter.

@henning - Can you explain what you mean by extraFields? Sounds interesting. Make sure you're using a ManyManyDataObjectManager for those relations.

Avatar
henning.blunck

14 April 2009 at 1:43am Community Member, 6 Posts

Hey,

@cheese: ok, if YOU didn't know extraFields by now, than it seems not to have such big popularity right now.

Formal speeching I refered to:
http://api.silverstripe.com/sapphire/core/DataObject.html#$many_many_extraFields
One of the very few (like 2-3) examples I found on the internet was the first post in this discussion:
http://groups.google.com/group/silverstripe-dev/browse_thread/thread/865b4b337c230b1c/f39328a56fc4afb4

I gave it a try: It basicly works very well. The relation table gets (beside an ID and fields to save the IDs of the two involved Records) further columns (in the above mentioned example, the table saving the Posts<->Categories Relationship gets a further column named "PrimeCategory" of type boolean).

In the meanwhile, I've found out, that managing this extraFields with manymanycomplextable fields is not yet possible (refering to the "ToDo" remark on http://doc.silverstripe.com/doku.php?id=manymanycomplextablefield)

Greets from Mannheim (Germany),

Henning

Avatar
UncleCheese

14 April 2009 at 2:11am 4085 Posts

Perfect! I've been looking for that functionality! I'll definitely look into it and hopefully get ManyManyDataObjectManager to support it. That's great news.

Avatar
Ben Gribaudo

14 April 2009 at 2:36am Community Member, 181 Posts

UncleCheese> The fix was to use the member method ComplexTableField::getParentIDName() to generate this fieldname correctly.

This fix helps a lot! Thank you!

Avatar
Ben Gribaudo

14 April 2009 at 2:59am Community Member, 181 Posts

Any chance we could create a forum folder for threads re Uncle Cheese's modules? This thread is so long that it is hard to quickly scan it to see if a particular topic/bug was already discussed. The Event Calendar Module thread is also very long.

Avatar
UncleCheese

14 April 2009 at 3:04am 4085 Posts

Yeah, i've been saying that for a while. Who do we need to talk to? SS Admins? Hello?!

Avatar
rndmerle

14 April 2009 at 4:48am (Last edited: 14 April 2009 4:58am), Community Member, 24 Posts

Hi.

Just to say I'm using ImageDataObjectManager with PNG images without any trouble.
I put $limitFileTypes = array ('jpg', 'png'); into ImageDataObjectManager.php

Be safe.