Hi,
I'm using a global ArticlePage pagetype for multiple websites. I use a decorator for each site to tweak the functionality as needed.
In some of the sites, some fields are not necessary so I have to remove them. But using $fields->removeByName('NameOfField') or $fields->removeFieldFromTab('Root.Content.Main','NameOfField') on the decorator doesn't seem to work.
Is this a bug? I'm using 2.4.7.
ArticlePageDecorator extends DataObjectDecorator {
function updateCMSFields($fields){
// not working
$fields->removeByName('NameOfField');
// oddly, this is working
$fields->addFieldToTab('Root.Content.Main', new TextField('TestField'));
}
}
:: I also found this 2-year-old page that looks to have the same issue: http://www.silverstripe.org/dataobjectmanager-module-forum/show/15402