Fixed "Priority" appears twice in CMS error

Cleanly ensure that even if updateCMSFields is called twice (due to other decorators) that it doesn't cause an error.

See here: http://www.silverstripe.org/all-other-modules/show/14827#post296739
This commit is contained in:
studiomelbourne 2013-01-11 12:28:39 +11:00
parent 61ad4dce88
commit 2048c3ea64
1 changed files with 5 additions and 2 deletions

View File

@ -38,7 +38,10 @@ class GoogleSitemapSiteTreeDecorator extends SiteTreeDecorator {
'0.2' => '9',
'0.1' => '10 - ' . _t('SiteTree.PRIORITYLEASTIMPORTANT', "Least important")
);
/* Remove GoogleSitemap tab if it already exists */
$fields->removeByName('GoogleSitemap');
$tabset = $fields->findOrMakeTab('Root.Content');
$message = "<p>";
@ -129,4 +132,4 @@ class GoogleSitemapSiteTreeDecorator extends SiteTreeDecorator {
$this->owner->ChangeFreq = 'always';
}
}
}
}