From 8cfdb972549aed03bcd5cbd05ea5b5b0316c2d6a Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 22 Jul 2021 07:44:45 +1200 Subject: [PATCH] dev/wordpress#109 fix bug when is_monetary is not checked This ensures the paymentProcessor is consistenly on the form regardless of is_monetary being checked https://lab.civicrm.org/dev/wordpress/-/issues/109 highlights that it has been 'required' even though we don't understand what it means. This removes that brittleness which we can't 'justify' from a logic point of view --- CRM/Contribute/Form/ContributionBase.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 58e15df2af..363e2d5a3d 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -336,7 +336,6 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { $this->assignBillingType(); // check for is_monetary status - $isMonetary = $this->_values['is_monetary'] ?? NULL; $isPayLater = $this->_values['is_pay_later'] ?? NULL; if (!empty($this->_ccid)) { $this->_values['financial_type_id'] = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', @@ -352,14 +351,12 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { $this->setPayLaterLabel($this->_values['pay_later_text']); } - if ($isMonetary) { - $this->_paymentProcessorIDs = array_filter(explode( - CRM_Core_DAO::VALUE_SEPARATOR, - CRM_Utils_Array::value('payment_processor', $this->_values) - )); + $this->_paymentProcessorIDs = array_filter(explode( + CRM_Core_DAO::VALUE_SEPARATOR, + CRM_Utils_Array::value('payment_processor', $this->_values) + )); - $this->assignPaymentProcessor($isPayLater); - } + $this->assignPaymentProcessor($isPayLater); // get price info // CRM-5095 -- 2.25.1