use setstatus directly to error message
authorSunil Pawar <sunil@cividesk.com>
Fri, 5 Jan 2018 06:05:32 +0000 (11:35 +0530)
committerSunil Pawar <sunil@cividesk.com>
Fri, 5 Jan 2018 06:05:32 +0000 (11:35 +0530)
CRM/Member/Form/Membership.php
CRM/Member/Form/MembershipRenewal.php

index f3f5ac0f049a44399de925db41747b93bfecda81..19a97a4053be67980eb762c0bbea7033b413a824 100644 (file)
@@ -1426,7 +1426,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
             CRM_Contribute_BAO_ContributionRecur::deleteRecurContribution($paymentParams['contributionRecurID']);
           }
 
-          CRM_Core_Error::displaySessionError($e);
+          CRM_Core_Session::singleton()->setStatus($e->getMessage());
           CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/view/membership',
             "reset=1&action=add&cid={$this->_contactID}&context=membership&mode={$this->_mode}"
           ));
index cadcbf5e5d81cd097b2152765f0c1e1cc7e20218..8edc1701093ea3fc9cdcacfbe39c52ca51eb1f5c 100644 (file)
@@ -469,7 +469,7 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
       return $statusMsg;
     }
     catch (\Civi\Payment\Exception\PaymentProcessorException $e) {
-      CRM_Core_Error::displaySessionError($e);
+      CRM_Core_Session::singleton()->setStatus($e->getMessage());
       CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/view/membership',
         "reset=1&action=renew&cid={$this->_contactID}&id={$this->_id}&context=membership&mode={$this->_mode}"
       ));