From 05f806190ffe00bc47e5e87a9f9fc43c2a5ba054 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 14 May 2021 18:17:29 +1200 Subject: [PATCH] Remove never-passed parameter from now unshared parameter --- CRM/Contribute/Form/Contribution/Confirm.php | 2 +- CRM/Member/BAO/Membership.php | 20 +++++--------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 9e20a3015b..736d2715ae 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -1709,7 +1709,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr date('YmdHis'), $membershipParams['cms_contactID'] ?? NULL, $customFieldsFormatted, $numTerms, $membershipID, $pending, - $contributionRecurID, $membershipSource, $isPayLater, $memParams, [], $membershipContribution, + $contributionRecurID, $membershipSource, $isPayLater, $memParams, $membershipContribution, $membershipLineItems ); diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 419e169c6d..490fa993f4 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -1775,7 +1775,6 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * @param $membershipSource * @param $isPayLater * @param array $memParams - * @param array $formDates * @param null|CRM_Contribute_BAO_Contribution $contribution * @param array $lineItems * @@ -1783,7 +1782,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public static function processMembership($contactID, $membershipTypeID, $is_test, $changeToday, $modifiedID, $customFieldsFormatted, $numRenewTerms, $membershipID, $pending, $contributionRecurID, $membershipSource, $isPayLater, $memParams = [], $formDates = [], $contribution = NULL, $lineItems = []) { + public static function processMembership($contactID, $membershipTypeID, $is_test, $changeToday, $modifiedID, $customFieldsFormatted, $numRenewTerms, $membershipID, $pending, $contributionRecurID, $membershipSource, $isPayLater, $memParams = [], $contribution = NULL, $lineItems = []) { $renewalMode = $updateStatusId = FALSE; $allStatus = CRM_Member_PseudoConstant::membershipStatus(); $format = '%Y%m%d'; @@ -1845,10 +1844,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND $currentMembership['join_date'] = CRM_Utils_Date::customFormat($currentMembership['join_date'], $format); foreach (['start_date', 'end_date'] as $dateType) { - $currentMembership[$dateType] = $formDates[$dateType] ?? NULL; - if (empty($currentMembership[$dateType])) { - $currentMembership[$dateType] = $dates[$dateType] ?? NULL; - } + $currentMembership[$dateType] = $dates[$dateType] ?? NULL; } $currentMembership['is_test'] = $is_test; @@ -1880,11 +1876,8 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND // Insert renewed dates for CURRENT membership $memParams['join_date'] = CRM_Utils_Date::isoToMysql($membership->join_date); - $memParams['start_date'] = $formDates['start_date'] ?? CRM_Utils_Date::isoToMysql($membership->start_date); - $memParams['end_date'] = $formDates['end_date'] ?? NULL; - if (empty($memParams['end_date'])) { - $memParams['end_date'] = $dates['end_date'] ?? NULL; - } + $memParams['start_date'] = CRM_Utils_Date::isoToMysql($membership->start_date); + $memParams['end_date'] = $dates['end_date'] ?? NULL; $memParams['membership_type_id'] = $membershipTypeID; //set the log start date. @@ -1918,10 +1911,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND $dates = CRM_Member_BAO_MembershipType::getDatesForMembershipType($membershipTypeID, NULL, NULL, NULL, $numRenewTerms); foreach (['join_date', 'start_date', 'end_date'] as $dateType) { - $memParams[$dateType] = $formDates[$dateType] ?? NULL; - if (empty($memParams[$dateType])) { - $memParams[$dateType] = $dates[$dateType] ?? NULL; - } + $memParams[$dateType] = $dates[$dateType] ?? NULL; } $status = CRM_Member_BAO_MembershipStatus::getMembershipStatusByDate(CRM_Utils_Date::customFormat($dates['start_date'], -- 2.25.1