From: Eileen McNaughton Date: Sat, 2 Dec 2023 23:27:28 +0000 (+1300) Subject: Fix notices on new membership X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6b856e4588d609f9085c405cdcf0f38003fc64b2;p=civicrm-core.git Fix notices on new membership --- 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;