Remove hurty free calls from campaign and case
authorSeamus Lee <seamuslee001@gmail.com>
Mon, 11 Feb 2019 07:48:39 +0000 (18:48 +1100)
committerSeamus Lee <seamuslee001@gmail.com>
Mon, 11 Feb 2019 07:48:39 +0000 (18:48 +1100)
CRM/Campaign/BAO/Campaign.php
CRM/Campaign/BAO/Survey.php
CRM/Campaign/Form/Task/Interview.php
CRM/Case/BAO/Case.php

index 9170beecb3b578fd0faf047e82468633b6407dea..a62f1e279af1f060c1b0220901bbdf714bff1e32 100644 (file)
@@ -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();
       }
     }
 
index 95987c774a288ec7745442f436c5c3c893502ed3..58c45b25e234460fa63543e676bcfc04c27dde16 100644 (file)
@@ -504,7 +504,6 @@ SELECT  survey.id    as id,
         );
         $voterDetails[$contact->contactId]['contact_type'] = $image;
       }
-      $contact->free();
     }
 
     return $voterDetails;
index 17ffa9cb02ca3c175d1d758998f1887bc3d74f18..82fdf3b6d32429d7d927ea3a894d1c7833ac21b7 100644 (file)
@@ -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;
   }
index 06102fe28a38a9990426609a0406a9d972892aac..9237e00d3e464ee50d010db19843dc7beb3580e4 100644 (file)
@@ -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;