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.

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.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Bug: Cannot add tab to a new tab in CMS


Go to End


3 Posts   3598 Views

Avatar
kcd

Community Member, 54 Posts

17 April 2009 at 4:50pm

The following:

function getCMSFields(){
$fields = parent::getCMSFields();
...

$fields->addFieldToTab('Root.Homepage', new HtmlEditorField('HomepageDescription', 'Homepage Description (Optional)'));
$fields->addFieldToTab('Root.Homepage.Display', new CheckboxField('ShowInHomepage', 'Show this special on the Homepage (customise below)'));
...

Throws the error:
User Error] FieldSet::addFieldToTab() Tried to add a tab to object 'Tab' named 'Homepage' - 'Display' didn't exist.
GET /admin?flush=1

Line 266 in D:\Websites\xampp\htdocs\sapphire\forms\FieldSet.php

Which is an error in findOrMakeTab when adding 'ExistingRoot.NewTab.NewSubTab'

Any suggestions or should i log this bug?
Also are tabs limited to three levels? (this bug prevents me finding out)

Avatar
kcd

Community Member, 54 Posts

17 April 2009 at 4:53pm

Edited: 17/04/2009 5:04pm

note it doesn't matter that I have already added the first new tab i.e.

findOrMakeTab('ExistingRoot.NewTab')
findOrMakeTab('ExistingRoot.NewTab.NewSubtab') <- this line throws the error

Another update:
In 2.3.1 the error is Line 270 in FieldSet.php

Avatar
werkzeugH

Community Member, 3 Posts

28 April 2009 at 10:41pm

you got any solution for this issue yet ?