From: Seamus Lee Date: Mon, 11 Feb 2019 01:20:11 +0000 (+1100) Subject: Remove free calls from Activity and Member sections of CRM X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b94d54d09c5676dcb5359c6b1a79529b18649830;p=civicrm-core.git Remove free calls from Activity and Member sections of CRM --- diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 7249a8e6d6..e4bee42129 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -2361,7 +2361,6 @@ AND cl.modified_id = c.id $priorActivities[$index][$dao->activityID]['name'] = $dao->name; $priorActivities[$index][$dao->activityID]['date'] = $dao->date; } - $dao->free(); } } return $priorActivities[$index]; @@ -2678,10 +2677,8 @@ AND cl.modified_id = c.id $result = self::deleteActivity($activityParams); } - $activityContactOther->free(); } - $activityContact->free(); $transaction->commit(); return $result; diff --git a/CRM/Activity/Page/AJAX.php b/CRM/Activity/Page/AJAX.php index 787c18d26d..e8be4c76e3 100644 --- a/CRM/Activity/Page/AJAX.php +++ b/CRM/Activity/Page/AJAX.php @@ -309,7 +309,6 @@ class CRM_Activity_Page_AJAX { $mainActivity->save(); $mainActivityId = $mainActivity->id; CRM_Activity_BAO_Activity::logActivityAction($mainActivity); - $mainActivity->free(); // Mark previous activity as deleted. If it was a non-case activity // then just change the subject. @@ -330,9 +329,7 @@ class CRM_Activity_Page_AJAX { } $otherActivity->save(); - $caseActivity->free(); } - $otherActivity->free(); $targetContacts = array(); if (!empty($params['targetContactIds'])) { @@ -385,7 +382,6 @@ class CRM_Activity_Page_AJAX { $params['mainActivityId'] = $mainActivityId; CRM_Activity_BAO_Activity::copyExtendedActivityData($params); CRM_Utils_Hook::post('create', 'CaseActivity', $caseActivity->id, $caseActivity); - $caseActivity->free(); return (array('error_msg' => $error_msg, 'newId' => $mainActivity->id)); } diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 00548c146e..cbc07cf2b6 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -94,7 +94,6 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership { $membership->id = $id; $membership->save(); - $membership->free(); if (empty($membership->contact_id) || empty($membership->status_id)) { // this means we are in renewal mode and are just updating the membership @@ -545,8 +544,6 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership { $defaults['active'] = TRUE; } - $membership->free(); - return $membership; } @@ -702,7 +699,6 @@ INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_ty self::deleteRelatedMemberships($membership->id); self::deleteMembership($membership->id); } - $membership->free(); } /** @@ -1184,7 +1180,6 @@ AND civicrm_membership.is_test = %2"; $memberDAO->end_date = CRM_Utils_Date::isoToMysql($memberDAO->end_date); $memberDAO->save(); CRM_Core_DAO::storeValues($memberDAO, $currentMembership); - $memberDAO->free(); $currentMembership['is_current_member'] = CRM_Core_DAO::getFieldValue( 'CRM_Member_DAO_MembershipStatus', @@ -1277,10 +1272,8 @@ SELECT c.contribution_page_id as pageID $relatedMembership->id = $membership->id; $relatedMembership->copyValues($params); $relatedMembership->save(); - $relatedMembership->free(); } - $membership->free(); } /** @@ -1407,7 +1400,6 @@ WHERE civicrm_membership.contact_id = civicrm_contact.id $nestedRelMembership->id = $membership->owner_membership_id; $nestedRelMembership->contact_id = $cid; $nestedRelationship = $nestedRelMembership->find(TRUE); - $nestedRelMembership->free(); } if (!$nestedRelationship) { $relatedContacts[$cid] = $status; @@ -1610,7 +1602,6 @@ FROM civicrm_membership_type $membershipTypeValues[$dao->id][$mtField] = $dao->$mtField; } } - $dao->free(); CRM_Utils_Hook::membershipTypeValues($form, $membershipTypeValues); @@ -2168,7 +2159,6 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND ]); $count++; } - $deceasedDAO->free(); return $count; } @@ -2279,7 +2269,6 @@ WHERE civicrm_membership.is_test = 0 while ($dao1->fetch()) { self::processOverriddenUntilDateMembership($dao1); } - $dao1->free(); $query = $baseQuery . " AND civicrm_membership.is_override IS NULL AND civicrm_membership.status_id NOT IN (%1, %2, %3, %4) @@ -2351,7 +2340,6 @@ WHERE civicrm_membership.is_test = 0 $updateCount++; } } - $dao2->free(); $result['is_error'] = 0; $result['messages'] = ts('Processed %1 membership records. Updated %2 records.', array( 1 => $processCount, diff --git a/CRM/Member/BAO/MembershipLog.php b/CRM/Member/BAO/MembershipLog.php index 686183c10b..3754427676 100644 --- a/CRM/Member/BAO/MembershipLog.php +++ b/CRM/Member/BAO/MembershipLog.php @@ -46,7 +46,6 @@ class CRM_Member_BAO_MembershipLog extends CRM_Member_DAO_MembershipLog { $membershipLog = new CRM_Member_DAO_MembershipLog(); $membershipLog->copyValues($params); $membershipLog->save(); - $membershipLog->free(); return $membershipLog; } diff --git a/CRM/Member/BAO/MembershipStatus.php b/CRM/Member/BAO/MembershipStatus.php index 30e00ec715..0f7f8ae419 100644 --- a/CRM/Member/BAO/MembershipStatus.php +++ b/CRM/Member/BAO/MembershipStatus.php @@ -212,7 +212,6 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus { } $membershipStatus->delete(); CRM_Member_PseudoConstant::flush('membershipStatus'); - $membershipStatus->free(); } /** @@ -361,8 +360,6 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus { } //end fetch - $membershipStatus->free(); - //we bundle the arguments into an array as we can't pass 8 variables to the hook otherwise // the membership array might contain the pre-altered settings so we don't want to merge this $arguments = array( @@ -394,7 +391,6 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus { while ($membershipStatus->fetch()) { $statusIds[] = $membershipStatus->id; } - $membershipStatus->free(); return $statusIds; } diff --git a/CRM/Member/BAO/MembershipType.php b/CRM/Member/BAO/MembershipType.php index 1d119d742e..6438cff3c0 100644 --- a/CRM/Member/BAO/MembershipType.php +++ b/CRM/Member/BAO/MembershipType.php @@ -281,7 +281,6 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { while ($membershipType->fetch()) { $membershipTypes[$membershipType->id] = $membershipType->name; } - $membershipType->free(); return $membershipTypes; } @@ -300,7 +299,6 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { $membershipType->id = $membershipTypeId; if ($membershipType->find(TRUE)) { CRM_Core_DAO::storeValues($membershipType, $membershipTypeDetails); - $membershipType->free(); return $membershipTypeDetails; } else {