From 100a45ff024b598bb1955c9d3f2a50f51e0b86ca Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 8 Aug 2015 22:16:39 -0400 Subject: [PATCH] CRM-15375 - Fix incorrect default language in i18n form --- CRM/Core/I18n/Form.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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; } -- 2.25.1