From: Eileen McNaughton Date: Tue, 3 Jun 2014 22:42:15 +0000 (+1200) Subject: test - fix api_mail_settings test X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e123fef41e664c1d75e91b9434a9d53f7f388cff;p=civicrm-core.git test - fix api_mail_settings test --- diff --git a/CRM/Core/BAO/MailSettings.php b/CRM/Core/BAO/MailSettings.php index 56d93923ac..c5699495a9 100644 --- a/CRM/Core/BAO/MailSettings.php +++ b/CRM/Core/BAO/MailSettings.php @@ -144,11 +144,13 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings { return $result; } - $params['is_ssl'] = CRM_Utils_Array::value('is_ssl', $params, FALSE); - $params['is_default'] = CRM_Utils_Array::value('is_default', $params, FALSE); + if(empty($params['id'])) { + $params['is_ssl'] = CRM_Utils_Array::value('is_ssl', $params, FALSE); + $params['is_default'] = CRM_Utils_Array::value('is_default', $params, FALSE); + } //handle is_default. - if ($params['is_default']) { + if (!empty($params['is_default'])) { $query = 'UPDATE civicrm_mail_settings SET is_default = 0 WHERE domain_id = %1'; $queryParams = array(1 => array(CRM_Core_Config::domainID(), 'Integer')); CRM_Core_DAO::executeQuery($query, $queryParams); @@ -180,7 +182,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings { } $transaction->commit(); - CRM_Core_BAO_MailSettings::defaultDomain(TRUE); + CRM_Core_BAO_MailSettings::defaultDAO(TRUE); return $mailSettings; }