Commit 6e5b5e59 authored by totten's avatar totten

CRM_Core_BAO_ConfigSetting::formatParams - Remove silly function

This function is basically just array_merge().

In theory, there's a side-effect where NULL values in `$values` are unset,
but neither use-case seems to make any use of `$values` afterward, and that
smells like an accidental side-effect anyway.
parent dc00ac6d
......@@ -181,7 +181,7 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting {
);
if (!empty($mailingBackend)) {
CRM_Core_BAO_ConfigSetting::formatParams($formValues, $mailingBackend);
$formValues = array_merge($mailingBackend, $formValues);
}
// if password is present, encrypt it
......
......@@ -65,8 +65,7 @@ class CRM_Core_BAO_ConfigSetting {
$domain->id = CRM_Core_Config::domainID();
$domain->find(TRUE);
if ($domain->config_backend) {
$values = unserialize($domain->config_backend);
self::formatParams($params, $values);
$params = array_merge(unserialize($domain->config_backend), $params);
}
// unset any of the variables we read from file that should not be stored in the database
......@@ -139,30 +138,6 @@ class CRM_Core_BAO_ConfigSetting {
}
}
/**
* Format the array containing before inserting in db.
*
* @param array $params
* Associated array of civicrm variables(submitted).
* @param array $values
* Associated array of civicrm variables stored in db.
*/
public static function formatParams(&$params, &$values) {
if (empty($params) ||
!is_array($params)
) {
$params = $values;
}
else {
foreach ($params as $key => $val) {
if (array_key_exists($key, $values)) {
unset($values[$key]);
}
}
$params = array_merge($params, $values);
}
}
/**
* 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