From 36601c735b23aa8de1df5f7cdd45b6f4164f7659 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Sat, 30 Jan 2021 17:26:19 +0000 Subject: [PATCH] Minor code cleanup to contribution pages --- CRM/Contribute/Form/Contribution/Main.php | 2 +- CRM/Contribute/Form/ContributionBase.php | 8 ++++++++ CRM/Price/BAO/PriceSet.php | 6 +++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 223d2c7805..6209a86596 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -371,7 +371,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu // If we configured price set for contribution page // we are not allow membership signup as well as any // other contribution amount field, CRM-5095 - if (isset($this->_priceSetId) && $this->_priceSetId) { + if (!empty($this->_priceSetId)) { $this->add('hidden', 'priceSetId', $this->_priceSetId); // build price set form. $this->set('priceSetId', $this->_priceSetId); diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 94eaf37d03..9749d03e47 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -207,6 +207,14 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { */ public $paymentInstrumentID; + /** + * The contribution ID - is an option in the URL if you are making a payment against an existing contribution (an + * "invoice payment"). + * + * @var int + */ + public $_ccid; + /** * Is the price set quick config. * @return bool diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php index 4795d8dbd2..7abeda7d0f 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -843,9 +843,9 @@ WHERE id = %1"; // Mark which field should have the auto-renew checkbox, if any. CRM-18305 if (!empty($form->_membershipTypeValues) && is_array($form->_membershipTypeValues)) { $autoRenewMembershipTypes = []; - foreach ($form->_membershipTypeValues as $membershiptTypeValue) { - if ($membershiptTypeValue['auto_renew']) { - $autoRenewMembershipTypes[] = $membershiptTypeValue['id']; + foreach ($form->_membershipTypeValues as $membershipTypeValue) { + if ($membershipTypeValue['auto_renew']) { + $autoRenewMembershipTypes[] = $membershipTypeValue['id']; } } foreach ($form->_priceSet['fields'] as $field) { -- 2.25.1