Be a bit more friendly rather than crashing with fatal when we can't update the subsc...
authorMatthew Wire <mjw@mjwconsult.co.uk>
Mon, 3 Apr 2017 14:15:41 +0000 (15:15 +0100)
committerMatthew Wire <mjw@mjwconsult.co.uk>
Mon, 3 Apr 2017 14:15:41 +0000 (15:15 +0100)
CRM/Contribute/Form/UpdateSubscription.php

index 59339217ed0be19bfbc2ddb638b6e44db0a56dbc..1baf49654bd57bde857c3d00ff2f583d375db1be 100644 (file)
@@ -101,17 +101,17 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Core_Form {
     }
 
     if (!$this->contributionRecurID || !$this->_subscriptionDetails) {
-      CRM_Core_Error::fatal('Required information missing.');
+      CRM_Core_Error::statusBounce(ts('Required information missing.'));
     }
 
     if ($this->_subscriptionDetails->membership_id && $this->_subscriptionDetails->auto_renew) {
-      CRM_Core_Error::fatal(ts('You cannot update the subscription.'));
+      CRM_Core_Error::statusBounce(ts('You cannot update the subscription.'));
     }
 
     if (!CRM_Core_Permission::check('edit contributions')) {
       $userChecksum = CRM_Utils_Request::retrieve('cs', 'String', $this, FALSE);
       if (!CRM_Contact_BAO_Contact_Utils::validChecksum($this->_subscriptionDetails->contact_id, $userChecksum)) {
-        CRM_Core_Error::fatal(ts('You do not have permission to update subscription.'));
+        CRM_Core_Error::statusBounce(ts('You do not have permission to update subscription.'));
       }
       $this->_selfService = TRUE;
     }