Swap out fatal for statusBounce for disabled or unpermittted forms
[civicrm-core.git] / CRM / Campaign / Form / SurveyType.php
index f6b37abe46fe61ff0021e56b1a281d530eabc9c3..85a3ff3ba3ab9c71f701dbeb613c68ebfc04f879 100644 (file)
@@ -44,6 +44,8 @@ class CRM_Campaign_Form_SurveyType extends CRM_Admin_Form {
 
   /**
    * Set variables up before form is built.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function preProcess() {
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this);
@@ -66,7 +68,7 @@ class CRM_Campaign_Form_SurveyType extends CRM_Admin_Form {
     if ($this->_id && in_array($this->_gName, CRM_Core_OptionGroup::$_domainIDGroups)) {
       $domainID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'domain_id', 'id');
       if (CRM_Core_Config::domainID() != $domainID) {
-        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.'));
       }
     }
   }