Jump to:

3372 Posts in 998 Topics by 712 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Bug: Cannot add tab to a new tab in CMS

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

Page: 1
Go to End
Author Topic: 2361 Views
  • kcd
    Avatar
    Community Member
    54 Posts

    Bug: Cannot add tab to a new tab in CMS Link to this post

    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)

  • kcd
    Avatar
    Community Member
    54 Posts

    Re: Bug: Cannot add tab to a new tab in CMS Link to this post

    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

  • werkzeugH
    Avatar
    Community Member
    3 Posts

    Re: Bug: Cannot add tab to a new tab in CMS Link to this post

    you got any solution for this issue yet ?

    2361 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.