From bed1a33ecf44e25543bda424629778e9f6ae3ef3 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 19 Oct 2020 19:48:45 +1300 Subject: [PATCH] Switch to calling the api Test cover in api_v3_ContactTest.testMergeOrganizations --- CRM/Member/BAO/Membership.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 41fa61e50f..60331c3330 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -1311,7 +1311,7 @@ WHERE civicrm_membership.contact_id = civicrm_contact.id * @throws \CiviCRM_API3_Exception */ public static function createRelatedMemberships($params, $dao) { - + unset($params['membership_id']); $membership = new CRM_Member_DAO_Membership(); $membership->id = $dao->id; @@ -1448,11 +1448,10 @@ WHERE civicrm_membership.contact_id = civicrm_contact.id // CRM-20966: Do not create membership_payment record for inherited membership. unset($params['relate_contribution_id']); - $ids = []; if (($params['status_id'] == $deceasedStatusId) || ($params['status_id'] == $expiredStatusId)) { // related membership is not active so does not count towards maximum if (!self::hasExistingInheritedMembership($params)) { - CRM_Member_BAO_Membership::create($params); + civicrm_api3('Membership', 'create', $params); } } else { -- 2.25.1