From a2bd58300071b3f7a1222b70142408ae45a7a5f6 Mon Sep 17 00:00:00 2001 From: larssandergreen Date: Fri, 11 Aug 2023 18:26:30 -0600 Subject: [PATCH] Use statusBounce instead of redirect when cannot delete custom group --- CRM/Custom/Form/DeleteGroup.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CRM/Custom/Form/DeleteGroup.php b/CRM/Custom/Form/DeleteGroup.php index 1fed29e919..1c498a2126 100644 --- a/CRM/Custom/Form/DeleteGroup.php +++ b/CRM/Custom/Form/DeleteGroup.php @@ -48,14 +48,13 @@ class CRM_Custom_Form_DeleteGroup extends CRM_Core_Form { CRM_Core_BAO_CustomGroup::retrieve($params, $defaults); $this->_title = $defaults['title']; - //check wheter this contain any custom fields + //check if this contains any custom fields $customField = new CRM_Core_DAO_CustomField(); $customField->custom_group_id = $this->_id; if ($customField->find(TRUE)) { - CRM_Core_Session::setStatus(ts("The Group '%1' cannot be deleted! You must Delete all custom fields in this group prior to deleting the group.", [1 => $this->_title]), ts('Deletion Error'), 'error'); - $url = CRM_Utils_System::url('civicrm/admin/custom/group', "reset=1"); - CRM_Utils_System::redirect($url); + CRM_Core_Error::statusBounce(ts("The Group '%1' cannot be deleted! You must Delete all custom fields in this group prior to deleting the group.", [1 => $this->_title]), + CRM_Utils_System::url('civicrm/admin/custom/group', "reset=1")); return TRUE; } $this->assign('title', $this->_title); -- 2.25.1