From 97875df1676e4a241d762789ed7dfad8481d6607 Mon Sep 17 00:00:00 2001 From: yashodha Date: Fri, 10 Jul 2015 15:27:44 +0530 Subject: [PATCH] CRM-16814: Scheduled Activity on a second case is deleted when the open date on the first case is changed ---------------------------------------- * CRM-16814: Scheduled Activity on a second case is deleted when the open date on the first case is changed https://issues.civicrm.org/jira/browse/CRM-16814 --- CRM/Case/XMLProcessor/Process.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/Case/XMLProcessor/Process.php b/CRM/Case/XMLProcessor/Process.php index 9276c2938d..e1a939532d 100644 --- a/CRM/Case/XMLProcessor/Process.php +++ b/CRM/Case/XMLProcessor/Process.php @@ -368,12 +368,14 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor { DELETE a FROM civicrm_activity a INNER JOIN civicrm_activity_contact t ON t.activity_id = a.id +INNER JOIN civicrm_case_activity ca on ca.activity_id = a.id WHERE t.contact_id = %1 AND t.record_type_id = $targetID AND a.is_auto = 1 AND a.is_current_revision = 1 +AND ca.case_id = %2 "; - $sqlParams = array(1 => array($params['clientID'], 'Integer')); + $sqlParams = array(1 => array($params['clientID'], 'Integer'), 2 => array($params['caseID'], 'Integer')); CRM_Core_DAO::executeQuery($query, $sqlParams); } -- 2.25.1