From 07bb4d12a978942393819ab09614e9000917d7b1 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 20 Nov 2023 10:44:59 +1300 Subject: [PATCH] Remove always-true membership_assign The combination of membership_assign and useForMember toggles whether the membership information shows up. It shows up when we are not showing line items - in which case it shows in the line item block instead - see https://github.com/civicrm/civicrm-core/pull/28181 membership_assign is Always assigned when this receipt is sent - hence it can go useForMember winds up being a pseudonym of isShowLineItems so this instance is replaced with that - #28181 replaces some further instances --- CRM/Contribute/BAO/Contribution.php | 2 -- CRM/Contribute/BAO/ContributionPage.php | 2 -- CRM/Contribute/Form/Contribution/Confirm.php | 3 --- 3 files changed, 7 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 331daa8996..06ec2be5a9 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -2632,8 +2632,6 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac foreach ($this->_relatedObjects['membership'] as $membership) { if ($membership->id) { $values['membership_id'] = $membership->id; - $values['membership_assign'] = TRUE; - // need to set the membership values here $template->assign('membership_name', CRM_Member_PseudoConstant::membershipType($membership->membership_type_id) diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php index 43c385ed56..9be8c666de 100644 --- a/CRM/Contribute/BAO/ContributionPage.php +++ b/CRM/Contribute/BAO/ContributionPage.php @@ -147,7 +147,6 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio 'customPre_grouptitle', 'customPost_grouptitle', 'useForMember', - 'membership_assign', 'amount', 'receipt_date', 'is_pay_later', @@ -351,7 +350,6 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio 'customPost' => $values['customPost'], 'customPost_grouptitle' => $values['customPost_grouptitle'], 'useForMember' => $values['useForMember'], - 'membership_assign' => $values['membership_assign'], 'amount' => $values['amount'], 'is_pay_later' => $values['is_pay_later'], 'receipt_date' => !$values['receipt_date'] ? NULL : date('YmdHis', strtotime($values['receipt_date'])), diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index abf4e44b16..d3172f995f 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -1368,7 +1368,6 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr $this->postProcessMembership($membershipParams, $contactID, $premiumParams, $customFieldsFormatted, $membershipType, $membershipTypeIDs, $isPaidMembership, $this->_membershipId, $isProcessSeparateMembershipTransaction, $financialTypeID, $membershipLineItems); - $this->assign('membership_assign', TRUE); $this->set('membershipTypeID', $membershipParams['selectMembership']); } @@ -1637,7 +1636,6 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr } $emailValues = array_merge($membershipParams, $this->_values); - $emailValues['membership_assign'] = 1; $emailValues['useForMember'] = !empty($this->_useForMember); $emailValues['membership_id'] = !empty($membership) ? $membership->id : NULL; @@ -2365,7 +2363,6 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr */ protected function doMembershipProcessing($contactID, $membershipParams, $premiumParams, $formLineItems) { if (!$this->_useForMember) { - $this->assign('membership_assign', TRUE); $this->set('membershipTypeID', $this->_params['selectMembership']); } -- 2.25.1