Fix notices on new membership
authorEileen McNaughton <emcnaughton@wikimedia.org>
Sat, 2 Dec 2023 23:27:28 +0000 (12:27 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Sat, 2 Dec 2023 23:27:28 +0000 (12:27 +1300)
CRM/Member/Form.php
CRM/Member/Page/Tab.php

index 269010d3948fb8e030c429ba56ab86d1a631f697..03c1d9e1703725d12cde573879e5ee9b12333911 100644 (file)
@@ -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');
index e6c543f1cd6681551663ddf03a09c3e623febb21..0f94f61cd3d2cf0a57e632eba565d73f9a14d4fb 100644 (file)
@@ -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;