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.
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
Bug Reports
Thanks for the tip about MultiSelectField.
I wanted to pick a solution that makes it easy to select a few dataobjects out of hundreds.
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.
Yeah, SimpleTinyMCE is the way to go. Those other two tools are fairly immature.
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')
)
Use setGridLabelField($fieldName);
Thanks!
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