From: Tim Otten Date: Thu, 17 Sep 2015 04:08:38 +0000 (-0700) Subject: CRM_Admin_Form_Preferences - Fix loading of settings X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=26cc63d36b1231ea89c75af7b8d9eef07c5797a2;p=civicrm-core.git CRM_Admin_Form_Preferences - Fix loading of settings --- diff --git a/CRM/Admin/Form/Preferences.php b/CRM/Admin/Form/Preferences.php index ef88e38a5d..d8e19ec4c8 100644 --- a/CRM/Admin/Form/Preferences.php +++ b/CRM/Admin/Form/Preferences.php @@ -85,10 +85,10 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form { $this->_config->contact_id = $this->_contactID; } + $settings = Civi::settings(); foreach ($this->_varNames as $groupName => $settingNames) { - $values = CRM_Core_BAO_Setting::getItem($groupName); - foreach ($values as $name => $value) { - $this->_config->$name = $value; + foreach ($settingNames as $settingName => $options) { + $this->_config->$settingName = $settings->get($settingName); } } $session->pushUserContext(CRM_Utils_System::url('civicrm/admin', 'reset=1')); diff --git a/CRM/Admin/Form/Preferences/Address.php b/CRM/Admin/Form/Preferences/Address.php index 61617e458f..17ec772b47 100644 --- a/CRM/Admin/Form/Preferences/Address.php +++ b/CRM/Admin/Form/Preferences/Address.php @@ -100,32 +100,8 @@ class CRM_Admin_Form_Preferences_Address extends CRM_Admin_Form_Preferences { $this->addressSequence = isset($newSequence) ? $newSequence : ""; - if (empty($this->_config->address_format)) { - $defaults['address_format'] = " -{contact.street_address} -{contact.supplemental_address_1} -{contact.supplemental_address_2} -{contact.city}{, }{contact.state_province}{ }{contact.postal_code} -{contact.country} -"; - } - else { - $defaults['address_format'] = $this->_config->address_format; - } - - if (empty($this->_config->mailing_format)) { - $defaults['mailing_format'] = " -{contact.addressee} -{contact.street_address} -{contact.supplemental_address_1} -{contact.supplemental_address_2} -{contact.city}{, }{contact.state_province}{ }{contact.postal_code} -{contact.country} -"; - } - else { - $defaults['mailing_format'] = $this->_config->mailing_format; - } + $defaults['address_format'] = $this->_config->address_format; + $defaults['mailing_format'] = $this->_config->mailing_format; parent::cbsDefaultValues($defaults);