From 6430500374c69819bc860556f3ff3e485c583d87 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 29 Nov 2023 23:27:31 +1300 Subject: [PATCH] Remove unreachable code --- CRM/Contribute/Form/Contribution/Confirm.php | 11 ----------- CRM/Contribute/Form/Contribution/Main.php | 13 ------------- CRM/Contribute/Form/Contribution/ThankYou.php | 11 ----------- 3 files changed, 35 deletions(-) diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index cc338c9fb6..7c0368b7ea 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -685,17 +685,6 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr } if (!empty($membershipTypeIds)) { - //set status message if wrong membershipType is included in membershipBlock - if ($this->getRenewalMembershipID() && !$membershipPriceset) { - $membershipTypeID = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', - $this->getRenewalMembershipID(), - 'membership_type_id' - ); - if (!in_array($membershipTypeID, $membershipTypeIds)) { - CRM_Core_Session::setStatus(ts("Oops. The membership you're trying to renew appears to be invalid. Contact your site administrator if you need assistance. If you continue, you will be issued a new membership."), ts('Invalid Membership'), 'error'); - } - } - $membershipTypeValues = CRM_Member_BAO_Membership::buildMembershipTypeValues($this, $membershipTypeIds); $endDate = NULL; diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 31407a467d..f107ab9657 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -636,19 +636,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu } if (!empty($membershipTypeIds)) { - //set status message if wrong membershipType is included in membershipBlock - // @todo - this appears to be unreachable - it seems likely it has been broken for - // a while so remove may be an OK alternative to fix - if ($this->getRenewalMembershipID() && !$membershipPriceset) { - $membershipTypeID = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', - $this->getRenewalMembershipID(), - 'membership_type_id' - ); - if (!in_array($membershipTypeID, $membershipTypeIds)) { - CRM_Core_Session::setStatus(ts("Oops. The membership you're trying to renew appears to be invalid. Contact your site administrator if you need assistance. If you continue, you will be issued a new membership."), ts('Invalid Membership'), 'error'); - } - } - $membershipTypeValues = CRM_Member_BAO_Membership::buildMembershipTypeValues($this, $membershipTypeIds); $this->_membershipTypeValues = $membershipTypeValues; $endDate = NULL; diff --git a/CRM/Contribute/Form/Contribution/ThankYou.php b/CRM/Contribute/Form/Contribution/ThankYou.php index 65490ef892..71f74da5c1 100644 --- a/CRM/Contribute/Form/Contribution/ThankYou.php +++ b/CRM/Contribute/Form/Contribution/ThankYou.php @@ -316,17 +316,6 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont } if (!empty($membershipTypeIds)) { - //set status message if wrong membershipType is included in membershipBlock - if ($this->getRenewalMembershipID() && !$membershipPriceset) { - $membershipTypeID = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', - $this->getRenewalMembershipID(), - 'membership_type_id' - ); - if (!in_array($membershipTypeID, $membershipTypeIds)) { - CRM_Core_Session::setStatus(ts("Oops. The membership you're trying to renew appears to be invalid. Contact your site administrator if you need assistance. If you continue, you will be issued a new membership."), ts('Invalid Membership'), 'error'); - } - } - $membershipTypeValues = CRM_Member_BAO_Membership::buildMembershipTypeValues($this, $membershipTypeIds); $endDate = NULL; -- 2.25.1