Permalink
Browse files

BUGFIX Setting 'Locale' as HiddenField in CMSMain->getEditForm() to s…

…upport 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
  • Loading branch information...
1 parent 52d067e commit af2f81e37a54ea0a75a74878a378d0323d73027c @chillu chillu committed Apr 13, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 code/CMSMain.php
View
@@ -333,7 +333,11 @@ public function getEditForm($id = null) {
}
} elseif ($id == 0) {
$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);
return $form;
} else {

0 comments on commit af2f81e

Please sign in to comment.