From: Coleman Watts Date: Sun, 9 Aug 2015 02:16:39 +0000 (-0400) Subject: CRM-15375 - Fix incorrect default language in i18n form X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=100a45ff024b598bb1955c9d3f2a50f51e0b86ca;p=civicrm-core.git CRM-15375 - Fix incorrect default language in i18n form --- diff --git a/CRM/Core/I18n/Form.php b/CRM/Core/I18n/Form.php index df679e4ecf..2b3170d2e4 100644 --- a/CRM/Core/I18n/Form.php +++ b/CRM/Core/I18n/Form.php @@ -75,17 +75,19 @@ class CRM_Core_I18n_Form extends CRM_Core_Form { } $required = !empty($widget['required']); + if ($widget['type'] == 'RichTextEditor') { + $widget['type'] = 'wysiwyg'; + $attributes['class'] .= ' collapsed'; + } + $languages = CRM_Core_I18n::languages(TRUE); foreach ($this->_locales as $locale) { + $attr = $attributes; $name = "{$field}_{$locale}"; if ($locale == $tsLocale) { - $attributes['class'] .= ' default-lang'; - } - if ($widget['type'] == 'RichTextEditor') { - $attributes['class'] .= ' collapsed'; - $widget['type'] = 'wysiwyg'; + $attr['class'] .= ' default-lang'; } - $this->add($widget['type'], $name, $languages[$locale], $attributes, $required); + $this->add($widget['type'], $name, $languages[$locale], $attr, $required); $this->_defaults[$name] = $dao->$locale; }