TabSet named 'Root' mandatory for a DataObject's CMS fields?

160 views
Skip to first unread message

baba-papa

unread,
Jan 11, 2013, 3:43:43 AM1/11/13
to silverst...@googlegroups.com
Refactoring our modules code for SS3 I stumbled over a new behavior. The method getCMSFields() of a DataObject must have a TabSet called 'Root' if there is a GridField in the tabs. The class GridFieldDetailForm.php has the following code on line 372ff:
if($form->Fields()->hasTabset()) {
$form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
$form->addExtraClass('cms-tabset');
}
Actually we have some child classes of DataObject that do not inherit their fields from DataObject (parent::getCMSFields()). I think we did this for performance reasons.
My question now: Is it a convention to have a TabSet called 'Root' in the FieldList returned by getCMSFields()?

Ingo Schommer

unread,
Jan 11, 2013, 4:06:43 AM1/11/13
to silverst...@googlegroups.com
Yes, that's a pretty long-standing convention.
It would be better to just say "apply template to all root tabsets"
in the GridFieldDetailForm context though, without hardcoding "Root",
by just iterating through FieldList->items. Do you want to give it a shot?


--
You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
To view this discussion on the web visit https://groups.google.com/d/msg/silverstripe-dev/-/WQXCJA-aXUAJ.
To post to this group, send email to silverst...@googlegroups.com.
To unsubscribe from this group, send email to silverstripe-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/silverstripe-dev?hl=en.

baba-papa

unread,
Jan 11, 2013, 11:07:29 AM1/11/13
to silverst...@googlegroups.com
Hello Ingo,
this is an easy one. I will provide a fix during the next week.
Reply all
Reply to author
Forward
0 new messages