Permalink
Browse files

BUGFIX Themes dropdown in SiteConfig::getCMSFields() should use setEm…

…ptyString() as the $emptyString argument is now deprecated.
  • Loading branch information...
1 parent d9ee61c commit 808819ec3b5cdff485706ce455bb11f62c7d0297 @halkyon halkyon committed May 24, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 code/model/SiteConfig.php
@@ -52,7 +52,7 @@ function getCMSFields() {
$tabMain = new Tab('Main',
$titleField = new TextField("Title", _t('SiteConfig.SITETITLE', "Site title")),
$taglineField = new TextField("Tagline", _t('SiteConfig.SITETAGLINE', "Site Tagline/Slogan")),
- new DropdownField("Theme", _t('SiteConfig.THEME', 'Theme'), $this->getAvailableThemes(), '', null, _t('SiteConfig.DEFAULTTHEME', '(Use default theme)'))
+ $themeDropdownField = new DropdownField("Theme", _t('SiteConfig.THEME', 'Theme'), $this->getAvailableThemes())
),
$tabAccess = new Tab('Access',
$viewersOptionsField = new OptionsetField("CanViewType", _t('SiteConfig.VIEWHEADER', "Who can view pages on this site?")),
@@ -68,6 +68,8 @@ function getCMSFields() {
)
);
+ $themeDropdownField->setEmptyString(_t('SiteConfig.DEFAULTTHEME', '(Use default theme)'));
+
$viewersOptionsSource = array();
$viewersOptionsSource["Anyone"] = _t('SiteTree.ACCESSANYONE', "Anyone");
$viewersOptionsSource["LoggedInUsers"] = _t('SiteTree.ACCESSLOGGEDIN', "Logged-in users");
@@ -81,11 +83,11 @@ function getCMSFields() {
$topLevelCreatorsOptionsField->setSource($editorsOptionsSource);
- // Translatable doesn't handle updateCMSFields on DataObjects,
- // so add it here to save the current Locale,
- // because onBeforeWrite does not work.
+ // Translatable doesn't handle updateCMSFields on DataObjects,
+ // so add it here to save the current Locale,
+ // because onBeforeWrite does not work.
if(class_exists('Translatable') && Object::has_extension('SiteConfig',"Translatable")){
- $fields->push(new HiddenField("Locale"));
+ $fields->push(new HiddenField("Locale"));
}
if (!Permission::check('EDIT_SITECONFIG')) {

0 comments on commit 808819e

Please sign in to comment.