Commit 2fa3eaf6 authored by totten's avatar totten

ConfigSetting::fixParams - Remove legacy handling for countryLimit,...

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.
parent 6e5b5e59
......@@ -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.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment