From b322ad6dff7ef7b7d3ec2fc8b75372c66d0a2009 Mon Sep 17 00:00:00 2001 From: Monish Deb Date: Fri, 9 Oct 2020 16:45:53 +0530 Subject: [PATCH] Update civix file and replace CRM_Core_Error::fatal --- CRM/Grant/BAO/GrantPayment.php | 6 +++--- CRM/Grant/BAO/GrantProgram.php | 2 +- CRM/Grant/Form/Task/Cancel.php | 2 +- CRM/Grant/Form/Task/Pay.php | 2 +- CRM/Grant/Form/Task/Reprint.php | 2 +- CRM/Grant/Form/Task/Update.php | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CRM/Grant/BAO/GrantPayment.php b/CRM/Grant/BAO/GrantPayment.php index c28edf5..544ec04 100755 --- a/CRM/Grant/BAO/GrantPayment.php +++ b/CRM/Grant/BAO/GrantPayment.php @@ -245,10 +245,10 @@ class CRM_Grant_BAO_GrantPayment extends CRM_Grant_DAO_GrantPayment { $dao->fetch(); if (!$dao->N) { if ($params['messageTemplateID']) { - CRM_Core_Error::fatal(ts('No such message template: id=%1.', array(1 => $params['messageTemplateID']))); + throw new CRM_Core_Exception(ts('No such message template: id=%1.', array(1 => $params['messageTemplateID']))); } else { - CRM_Core_Error::fatal(ts('No such message template: option group %1, option value %2.', array(1 => $params['groupName'], 2 => $params['valueName']))); + throw new CRM_Core_Exception(ts('No such message template: option group %1, option value %2.', array(1 => $params['groupName'], 2 => $params['valueName']))); } } @@ -317,7 +317,7 @@ class CRM_Grant_BAO_GrantPayment extends CRM_Grant_DAO_GrantPayment { $grantDao->fetch(); if (!$grantDao->N) { - CRM_Core_Error::fatal(ts('No such message template.')); + throw new CRM_Core_Exception(ts('No such message template.')); } $subject = $grantDao->subject; $html = $grantDao->html; diff --git a/CRM/Grant/BAO/GrantProgram.php b/CRM/Grant/BAO/GrantProgram.php index 10c29a2..4629585 100755 --- a/CRM/Grant/BAO/GrantProgram.php +++ b/CRM/Grant/BAO/GrantProgram.php @@ -55,7 +55,7 @@ class CRM_Grant_BAO_GrantProgram extends CRM_Grant_DAO_GrantProgram { */ static function del($grantProgramID) { if (!$grantProgramID) { - CRM_Core_Error::fatal(ts('Invalid value passed to delete function')); + throw new CRM_Core_Exception(ts('Invalid value passed to delete function')); } $dao = new CRM_Grant_DAO_GrantProgram(); diff --git a/CRM/Grant/Form/Task/Cancel.php b/CRM/Grant/Form/Task/Cancel.php index dc2b054..a10b03a 100755 --- a/CRM/Grant/Form/Task/Cancel.php +++ b/CRM/Grant/Form/Task/Cancel.php @@ -51,7 +51,7 @@ class CRM_Grant_Form_Task_Cancel extends CRM_Grant_Form_PaymentTask { //check permission for delete. if (!CRM_Core_Permission::checkActionPermission('CiviGrant', CRM_Core_Action::DELETE)) { - CRM_Core_Error::fatal(ts('You do not have permission to access this page')); + throw new CRM_Core_Exception(ts('You do not have permission to access this page')); } } diff --git a/CRM/Grant/Form/Task/Pay.php b/CRM/Grant/Form/Task/Pay.php index c53c390..bdc1152 100755 --- a/CRM/Grant/Form/Task/Pay.php +++ b/CRM/Grant/Form/Task/Pay.php @@ -53,7 +53,7 @@ class CRM_Grant_Form_Task_Pay extends CRM_Grant_Form_Task { function preProcess() { parent::preProcess(); if (!CRM_Core_Permission::check('create payments in CiviGrant')) { - CRM_Core_Error::fatal(ts( 'You do not have permission to access this page')); + throw new CRM_Core_Exception(ts( 'You do not have permission to access this page')); } } diff --git a/CRM/Grant/Form/Task/Reprint.php b/CRM/Grant/Form/Task/Reprint.php index 66ffde6..4a0fe7b 100755 --- a/CRM/Grant/Form/Task/Reprint.php +++ b/CRM/Grant/Form/Task/Reprint.php @@ -21,7 +21,7 @@ class CRM_Grant_Form_Task_Reprint extends CRM_Grant_Form_PaymentTask { function preProcess() { parent::preProcess(); if (!CRM_Core_Permission::check('create payments in CiviGrant')) { - CRM_Core_Error::fatal( ts( 'You do not have permission to access this page' ) ); + throw new CRM_Core_Exception( ts( 'You do not have permission to access this page' ) ); } $validIDs = CRM_Utils_Array::collect('id', CRM_Core_DAO::executeQuery( sprintf( diff --git a/CRM/Grant/Form/Task/Update.php b/CRM/Grant/Form/Task/Update.php index cc518e0..0480311 100644 --- a/CRM/Grant/Form/Task/Update.php +++ b/CRM/Grant/Form/Task/Update.php @@ -51,7 +51,7 @@ class CRM_Grant_Form_Task_Update extends CRM_Grant_Form_Task { //check permission for update. if (!CRM_Core_Permission::checkActionPermission('CiviGrant', CRM_Core_Action::UPDATE)) { - CRM_Core_Error::fatal(ts('You do not have permission to access this page')); + throw new CRM_Core_Exception(ts('You do not have permission to access this page')); } } -- GitLab