From 26cc63d36b1231ea89c75af7b8d9eef07c5797a2 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 16 Sep 2015 21:08:38 -0700 Subject: [PATCH] CRM_Admin_Form_Preferences - Fix loading of settings --- CRM/Admin/Form/Preferences.php | 6 +++--- CRM/Admin/Form/Preferences/Address.php | 28 ++------------------------ 2 files changed, 5 insertions(+), 29 deletions(-) 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); -- 2.25.1