From: Tim Otten Date: Fri, 4 Mar 2022 23:46:49 +0000 (-0800) Subject: format_locale - Present single-value option. Fix display of null value. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9d14b6f716d5db15fce70a1648c6c206f3557047;p=civicrm-core.git format_locale - Present single-value option. Fix display of null value. Overview: Fix display of new setting in admin form. Before: Field incorrectly displays as multi-value selection. After: Field displays as single-value selection. The null value is specifically allowed. --- diff --git a/CRM/Core/I18n.php b/CRM/Core/I18n.php index 3b471c950e..9b8fdcc1bf 100644 --- a/CRM/Core/I18n.php +++ b/CRM/Core/I18n.php @@ -246,9 +246,10 @@ class CRM_Core_I18n { * * @return array */ - public static function getLocaleOptions(): array { + public static function getFormatLocales(): array { $values = CRM_Core_OptionValue::getValues(['name' => 'languages'], $optionValues, 'label', TRUE); $return = []; + $return[NULL] = ts('Inherit from language'); foreach ($values as $value) { $return[$value['name']] = $value['label']; } diff --git a/settings/Localization.setting.php b/settings/Localization.setting.php index 4c09df3ad1..6a55c01d98 100644 --- a/settings/Localization.setting.php +++ b/settings/Localization.setting.php @@ -417,7 +417,6 @@ return [ 'quick_form_type' => 'Select', 'html_type' => 'Select', 'html_attributes' => [ - 'multiple' => 0, 'class' => 'crm-select2', ], 'default' => NULL, @@ -427,7 +426,7 @@ return [ 'is_contact' => 0, 'help_text' => NULL, 'pseudoconstant' => [ - 'callback' => 'CRM_Core_I18n::getLocaleOptions', + 'callback' => 'CRM_Core_I18n::getFormatLocales', ], 'description' => ts('Locale to use when formatting money (and in future dates). This replaces thousandsSeparator & decimalSeparator & moneyFormat settings.'), ],