Skip to content

Commit

Permalink
MailSettings BAO - Fix faulty assumption that we are always using the…
Browse files Browse the repository at this point in the history
… current domain
  • Loading branch information
colemanw committed Mar 27, 2020
1 parent c9edf5a commit 938e859
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CRM/Core/BAO/MailSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ public static function add(&$params) {

//handle is_default.
if (!empty($params['is_default'])) {
$domain = $params['domain_id'] ?? CRM_Core_DAO::getFieldValue(__CLASS__, $params['id'], 'domain_id');
$query = 'UPDATE civicrm_mail_settings SET is_default = 0 WHERE domain_id = %1';
$queryParams = [1 => [CRM_Core_Config::domainID(), 'Integer']];
CRM_Core_DAO::executeQuery($query, $queryParams);
CRM_Core_DAO::executeQuery($query, [1 => [$domain, 'Integer']]);
}

$mailSettings = new CRM_Core_DAO_MailSettings();
Expand Down

0 comments on commit 938e859

Please sign in to comment.