From 6b856e4588d609f9085c405cdcf0f38003fc64b2 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sun, 3 Dec 2023 12:27:28 +1300 Subject: [PATCH] Fix notices on new membership --- CRM/Member/Form.php | 3 ++- CRM/Member/Page/Tab.php | 10 +++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CRM/Member/Form.php b/CRM/Member/Form.php index 269010d394..03c1d9e170 100644 --- a/CRM/Member/Form.php +++ b/CRM/Member/Form.php @@ -208,7 +208,8 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment { // all possible statuses are disabled - redirect back to contact form CRM_Core_Error::statusBounce(ts('There are no configured membership statuses. You cannot add this membership until your membership statuses are correctly configured')); } - + // This should be overwritten from the contribution.... + $this->assign('currency', \Civi::settings()->get('defaultCurrency')); parent::preProcess(); $params = []; $params['context'] = CRM_Utils_Request::retrieve('context', 'Alphanumeric', $this, FALSE, 'membership'); diff --git a/CRM/Member/Page/Tab.php b/CRM/Member/Page/Tab.php index e6c543f1cd..0f94f61cd3 100644 --- a/CRM/Member/Page/Tab.php +++ b/CRM/Member/Page/Tab.php @@ -372,13 +372,9 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { $this->assign('accessContribution', TRUE); //show associated soft credit when contribution payment is paid by different person - if ($this->_id && $this->_contactId) { - $softCreditList = CRM_Contribute_BAO_ContributionSoft::getSoftContributionList($this->_contactId, $this->_id); - if (!empty($softCreditList)) { - $this->assign('softCredit', TRUE); - $this->assign('softCreditRows', $softCreditList); - } - } + $softCreditList = ($this->_id && $this->_contactId) ? CRM_Contribute_BAO_ContributionSoft::getSoftContributionList($this->_contactId, $this->_id) : FALSE; + $this->assign('softCredit', (bool) $softCreditList); + $this->assign('softCreditRows', $softCreditList); } else { $this->_accessContribution = FALSE; -- 2.25.1