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

Bug Reports


Reply

297 Posts   49681 Views

Avatar
UncleCheese

9 January 2010 at 4:51am 4085 Posts

I'll take a look at it.. I'm wondering, however, why you wouldn't just use a CheckboxSetField or MultiSelectField to create that relationship. If products are already managed in ModelAdmin, why create multiple workflows for creating them? The DOM seems like overkill in this case.

Avatar
andy_steel

9 January 2010 at 4:59am (Last edited: 9 January 2010 5:05am), Community Member, 31 Posts

Thanks for the tip about MultiSelectField.

I wanted to pick a solution that makes it easy to select a few dataobjects out of hundreds.

Avatar
yurigoul

11 January 2010 at 5:28am (Last edited: 11 January 2010 5:29am), Community Member, 202 Posts

SimpleHTMLEditorfield: produces something like this:

<div><div>paragraph1</div><div><br></div><div>paragraph2</div></div>

- <br> should be <br /> if I am using some form of xhtml. I could not find a switch to change this behavior.
- for some reason br is encapsulated by div, this makes the code less clean
- Sometimes text does and sometimes text does not get encapsulated by div(s). I think it would be better to encapsulate it in p, and make this standard behavior (so you know what to expect in the output).

I consider this a bug, but people might disagree of course :-)

I have now switched to SimpleTinyMCEField because it did not have any of these issues.

Avatar
UncleCheese

11 January 2010 at 7:14am 4085 Posts

Yeah, SimpleTinyMCE is the way to go. Those other two tools are fairly immature.

Avatar
Andrew Houle

15 January 2010 at 10:42am Community Member, 132 Posts

I have a nested FiledDataObject manager. Everything behaves ok, but the name under the file pulls the ID and not the caption that I want. This is my code:

new FileDataObjectManager(
$this,
'ImageFiles',
'ImageFile',
'Photo',
array('Caption'=>'Caption')
)

Avatar
UncleCheese

15 January 2010 at 2:32pm 4085 Posts

Use setGridLabelField($fieldName);

Avatar
Andrew Houle

16 January 2010 at 3:07am Community Member, 132 Posts

Thanks!

Avatar
banal

17 January 2010 at 6:54am Community Member, 901 Posts

Hey UncleCheese
While working with the DOM we found a bug with modifying permissions on a DOM instance.
The culprit is the removePermission method where it's impossible to remove the "add" permission. The root of the problem is that you're not checking the array key with strict typing, so that array key 0 equals false!

Here you'll find a patch that fixes the issue:
http://bummzack.ch/misc/dataobjectmanager_add.patch