From 0e994f087f8576a66133081aca31a9180e276195 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Thu, 11 Sep 2014 20:09:51 +0530 Subject: [PATCH] CRM-15276 fixes - DB Syntax Error on saving new mailing component with checked is_default https://issues.civicrm.org/jira/browse/CRM-15276 --- CRM/Mailing/BAO/Component.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Mailing/BAO/Component.php b/CRM/Mailing/BAO/Component.php index 2c23cdf5d5..55dd8b35fb 100644 --- a/CRM/Mailing/BAO/Component.php +++ b/CRM/Mailing/BAO/Component.php @@ -98,7 +98,7 @@ class CRM_Mailing_BAO_Component extends CRM_Mailing_DAO_Component { $component->body_text = CRM_Utils_String::htmlToText(CRM_Utils_Array::value('body_html', $params)); } - if ($component->is_default) { + if ($component->is_default && !empty($id)) { CRM_Core_DAO::executeQuery("UPDATE civicrm_mailing_component SET is_default = 0 WHERE component_type ='{$component->component_type}' AND id <> $id"); } -- 2.25.1