BUGFIX Setting 'Locale' as HiddenField in CMSMain->getEditForm() to support translatable SiteConfig records (see r97370, #4770) (from r97472)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@102715 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-13 20:37:16 +00:00
parent 52d067ead4
commit af2f81e37a

View File

@ -333,7 +333,11 @@ JS;
} }
} elseif ($id == 0) { } elseif ($id == 0) {
$siteConfig = SiteConfig::current_site_config(); $siteConfig = SiteConfig::current_site_config();
$form = new Form($this, "EditForm", $siteConfig->getFormFields(), $siteConfig->getFormActions()); $fields = $siteConfig->getFormFields();
if(Object::has_extension('SiteConfig',"Translatable")){
$fields->push(new HiddenField('Locale','', $siteConfig->Locale ));
}
$form = new Form($this, "EditForm", $fields, $siteConfig->getFormActions());
$form->loadDataFrom($siteConfig); $form->loadDataFrom($siteConfig);
return $form; return $form;
} else { } else {