7912 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » DataObjectManager: canCreate()
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | ||
| Author | Topic: | 1490 Views |
-
Re: DataObjectManager: canCreate()

26 August 2010 at 5:38pm
Hi UncleCheese,
Is this how I should I do it?
foreach( $fields as $field) {
....
}I tried this but the page just froze. It might have looped over a huge set.
Btw, how do you find the DOM through looping the fields?
-
Re: DataObjectManager: canCreate()

27 August 2010 at 1:29am
Yeah, you can do it that way..
foreach($fields as $field) {
if($field->class == "DataObjectManager") {
$field->setPermissions(array());
break;
}
} -
Re: DataObjectManager: canCreate()

8 September 2010 at 3:21am
I have come accross a similar issue before, I believe it is because (strangely) the Docorator fields are added before the standard class fields, so you can't manipulate them from the decorator. My issue arose when trying to specify the position of a decorated field in relation to a standard field, SS just didn't insert the new field as it couldn't find the one I was trying to position it above.
I gave up in the end, so I am not sure what the solution is to this problem is....it seems like it probably needs a core change in order to include decorated fields last.
Aram
-
Re: DataObjectManager: canCreate()

8 September 2010 at 4:34am
That's really bizarre, because to my knowledge, the updateCMSFields() (or any extend() method, for that matter) is always the last thing a native function does. I've never seen it called from the top of the function.
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com
| 1490 Views | ||
| Go to Top |


