diff --git a/CRM/Admin/Form/SettingTrait.php b/CRM/Admin/Form/SettingTrait.php index 184caa73423c..61b45298b3f2 100644 --- a/CRM/Admin/Form/SettingTrait.php +++ b/CRM/Admin/Form/SettingTrait.php @@ -213,9 +213,7 @@ protected function addFieldsDefinedInSettingsMetadata() { ); } elseif ($add === 'addChainSelect') { - $this->addChainSelect($setting, [ - 'label' => $props['title'], - ]); + $this->addChainSelect($setting, ['label' => $props['title']] + $props['chain_select_settings']); } elseif ($add === 'addMonthDay') { $this->add('date', $setting, $props['title'], CRM_Core_SelectValues::date(NULL, 'M d')); @@ -288,6 +286,7 @@ protected function getQuickFormType($spec) { 'text' => 'Element', 'entity_reference' => 'EntityRef', 'advmultiselect' => 'Element', + 'chainselect' => 'ChainSelect', ]; $mapping += array_fill_keys(CRM_Core_Form::$html5Types, ''); return $mapping[$htmlType] ?? ''; diff --git a/settings/Localization.setting.php b/settings/Localization.setting.php index 6854b522594d..ec1be4f3bbfc 100644 --- a/settings/Localization.setting.php +++ b/settings/Localization.setting.php @@ -155,6 +155,9 @@ 'type' => 'Integer', 'quick_form_type' => 'ChainSelect', 'html_type' => 'ChainSelect', + 'chain_select_settings' => [ + 'control_field' => 'defaultContactCountry', + ], //'pseudoconstant' => array( // 'callback' => 'CRM_Core_PseudoConstant::stateProvince', //),