From: Tim Otten Date: Mon, 7 Sep 2015 23:54:56 +0000 (-0700) Subject: ConfigSetting::fixParams - Remove legacy handling for countryLimit, provinceLimit... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2fa3eaf68bd043292ede29a074a92c4986f3bc94;p=civicrm-core.git ConfigSetting::fixParams - Remove legacy handling for countryLimit, provinceLimit, defaultContactCountry This appears to be migration logic for handling a change in the format of select config fields. The migration logic appears to originate before v3.0. Since we're only supporting upgrades from v4.0+, there's no point in keeping it. --- diff --git a/CRM/Core/BAO/ConfigSetting.php b/CRM/Core/BAO/ConfigSetting.php index b632a72a23..6c7dcf4342 100644 --- a/CRM/Core/BAO/ConfigSetting.php +++ b/CRM/Core/BAO/ConfigSetting.php @@ -59,8 +59,6 @@ class CRM_Core_BAO_ConfigSetting { * Associated array of civicrm variables. */ public static function add(&$params) { - self::fixParams($params); - $domain = new CRM_Core_DAO_Domain(); $domain->id = CRM_Core_Config::domainID(); $domain->find(TRUE); @@ -108,36 +106,6 @@ class CRM_Core_BAO_ConfigSetting { $domain->save(); } - /** - * Fix civicrm setting variables. - * - * @param array $params - * Associated array of civicrm variables. - */ - public static function fixParams(&$params) { - // in our old civicrm.settings.php we were using ISO code for country and - // province limit, now we have changed it to use ids - - $countryIsoCodes = CRM_Core_PseudoConstant::countryIsoCode(); - - $specialArray = array('countryLimit', 'provinceLimit'); - - foreach ($params as $key => $value) { - if (in_array($key, $specialArray) && is_array($value)) { - foreach ($value as $k => $val) { - if (!is_numeric($val)) { - $params[$key][$k] = array_search($val, $countryIsoCodes); - } - } - } - elseif ($key == 'defaultContactCountry') { - if (!is_numeric($value)) { - $params[$key] = array_search($value, $countryIsoCodes); - } - } - } - } - /** * Retrieve the settings values from db. *