Swap out fatal for statusBounce for disabled or unpermittted forms
[civicrm-core.git] / CRM / Event / Form / ManageEvent / Delete.php
index 30dc58e441fa7ad21480962906c4ed17db8ef342..376800f00c19a8d0a71e411779edb6319297baca 100644 (file)
@@ -29,6 +29,9 @@ class CRM_Event_Form_ManageEvent_Delete extends CRM_Event_Form_ManageEvent {
 
   /**
    * Set variables up before form is built.
+   *
+   * @throws \CiviCRM_API3_Exception
+   * @throws \CRM_Core_Exception
    */
   public function preProcess() {
     parent::preProcess();
@@ -41,7 +44,7 @@ class CRM_Event_Form_ManageEvent_Delete extends CRM_Event_Form_ManageEvent {
     }
 
     if (!CRM_Event_BAO_Event::checkPermission($this->_id, CRM_Core_Permission::DELETE)) {
-      CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
+      CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
     }
   }