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.

Data Model Questions

Bug: Cannot add tab to a new tab in CMS


3 Posts   2441 Views


17 April 2009 at 4:50pm Community Member, 54 Posts

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)


17 April 2009 at 4:53pm (Last edited: 17 April 2009 5:04pm), Community Member, 54 Posts

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

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

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


28 April 2009 at 10:41pm Community Member, 3 Posts

you got any solution for this issue yet ?