From 31e00b1827a340e74f65717e02b198ba4ed98d16 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 11 Feb 2019 18:48:39 +1100 Subject: [PATCH] Remove hurty free calls from campaign and case --- CRM/Campaign/BAO/Campaign.php | 1 - CRM/Campaign/BAO/Survey.php | 1 - CRM/Campaign/Form/Task/Interview.php | 1 - CRM/Case/BAO/Case.php | 17 ----------------- 4 files changed, 20 deletions(-) diff --git a/CRM/Campaign/BAO/Campaign.php b/CRM/Campaign/BAO/Campaign.php index 9170beecb3..a62f1e279a 100644 --- a/CRM/Campaign/BAO/Campaign.php +++ b/CRM/Campaign/BAO/Campaign.php @@ -93,7 +93,6 @@ class CRM_Campaign_BAO_Campaign extends CRM_Campaign_DAO_Campaign { $dao->entity_id = $entityId; $dao->group_type = 'Include'; $dao->save(); - $dao->free(); } } diff --git a/CRM/Campaign/BAO/Survey.php b/CRM/Campaign/BAO/Survey.php index 95987c774a..58c45b25e2 100644 --- a/CRM/Campaign/BAO/Survey.php +++ b/CRM/Campaign/BAO/Survey.php @@ -504,7 +504,6 @@ SELECT survey.id as id, ); $voterDetails[$contact->contactId]['contact_type'] = $image; } - $contact->free(); } return $voterDetails; diff --git a/CRM/Campaign/Form/Task/Interview.php b/CRM/Campaign/Form/Task/Interview.php index 17ffa9cb02..82fdf3b6d3 100644 --- a/CRM/Campaign/Form/Task/Interview.php +++ b/CRM/Campaign/Form/Task/Interview.php @@ -559,7 +559,6 @@ WHERE {$clause} //really this should use Activity BAO& not be here but refactoring will have to be later //actually the whole ajax call could be done as an api ajax call & post hook would be sorted CRM_Utils_Hook::post('edit', 'Activity', $activity->id, $activity); - $activity->free(); return $activityId; } diff --git a/CRM/Case/BAO/Case.php b/CRM/Case/BAO/Case.php index 06102fe28a..9237e00d3e 100644 --- a/CRM/Case/BAO/Case.php +++ b/CRM/Case/BAO/Case.php @@ -2195,8 +2195,6 @@ SELECT civicrm_contact.id as casemanager_id, } } - $mainCase->free(); - $mainCaseIds[] = $mainCaseId; //insert record for case contact. $otherCaseContact = new CRM_Case_DAO_CaseContact(); @@ -2213,9 +2211,7 @@ SELECT civicrm_contact.id as casemanager_id, if (!$mainCaseContact->find(TRUE)) { $mainCaseContact->save(); } - $mainCaseContact->free(); } - $otherCaseContact->free(); } elseif (!$otherContactId) { $otherContactId = $mainContactId; @@ -2299,8 +2295,6 @@ SELECT id // insert log of all activities CRM_Activity_BAO_Activity::logActivityAction($mainActivity); - $otherActivity->free(); - $mainActivity->free(); $copiedActivityIds[] = $otherActivityId; //create case activity record. @@ -2308,7 +2302,6 @@ SELECT id $mainCaseActivity->case_id = $mainCaseId; $mainCaseActivity->activity_id = $mainActivityId; $mainCaseActivity->save(); - $mainCaseActivity->free(); //migrate source activity. $otherSourceActivity = new CRM_Activity_DAO_ActivityContact(); @@ -2327,9 +2320,7 @@ SELECT id if (!$mainActivitySource->find(TRUE)) { $mainActivitySource->save(); } - $mainActivitySource->free(); } - $otherSourceActivity->free(); //migrate target activities. $otherTargetActivity = new CRM_Activity_DAO_ActivityContact(); @@ -2348,9 +2339,7 @@ SELECT id if (!$mainActivityTarget->find(TRUE)) { $mainActivityTarget->save(); } - $mainActivityTarget->free(); } - $otherTargetActivity->free(); //migrate assignee activities. $otherAssigneeActivity = new CRM_Activity_DAO_ActivityContact(); @@ -2369,9 +2358,7 @@ SELECT id if (!$mainAssigneeActivity->find(TRUE)) { $mainAssigneeActivity->save(); } - $mainAssigneeActivity->free(); } - $otherAssigneeActivity->free(); // copy custom fields and attachments $aparams = array( @@ -2417,14 +2404,12 @@ SELECT id if (!$mainRelationship->find(TRUE)) { $mainRelationship->save(); } - $mainRelationship->free(); //get the other relationship ids to update end date. if ($updateOtherRel) { $otherRelationshipIds[$otherRelationship->id] = $otherRelationship->id; } } - $otherRelationship->free(); //update other relationships end dates if (!empty($otherRelationshipIds)) { @@ -2501,7 +2486,6 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; if (!$mergeActivityId) { continue; } - $mergeActivity->free(); //connect merge activity to case. $mergeCaseAct = array( @@ -3116,7 +3100,6 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; if (!$newRelationship->find(TRUE)) { $newRelationship->save(); } - $newRelationship->free(); // store relationship type of newly created relationship $relationshipTypes[] = $caseRelationships->relationship_type_id; -- 2.25.1