From: yashodha Date: Fri, 10 Jul 2015 09:57:44 +0000 (+0530) Subject: CRM-16814: Scheduled Activity on a second case is deleted when the open date on the... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=97875df1676e4a241d762789ed7dfad8481d6607;p=civicrm-core.git 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 --- 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); }