From: Brian Shaughnessy Date: Tue, 17 Dec 2013 01:54:21 +0000 (-0500) Subject: CRM-13994 delete entity_tag records when deleting activity X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=93bcc9e8e2944c5fca7beb7bba4607fa4856d7c1;p=civicrm-core.git CRM-13994 delete entity_tag records when deleting activity --- diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index c3913949a8..6d07e44b6e 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -192,6 +192,10 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { // CRM-8708 $activity->case_id = CRM_Case_BAO_Case::getCaseIdByActivityId($activity->id); + + // CRM-13994 delete activity entity_tag + $query = "DELETE FROM civicrm_entity_tag WHERE entity_table = 'civicrm_activity' AND entity_id = {$activity->id}"; + $dao = CRM_Core_DAO::executeQuery($query); } } else { @@ -201,9 +205,9 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { $activity->is_deleted = 1; $result = $activity->save(); - //log activty delete.CRM-4525. - $logMsg = 'Case Activity deleted for'; - $msgs = array(); + // CRM-4525 log activity delete + $logMsg = 'Case Activity deleted for'; + $msgs = array(); $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);