From ba67bbeda2de340fb272d03721b986540c6322fc Mon Sep 17 00:00:00 2001 From: Brienne Kordis Date: Mon, 12 Dec 2022 16:03:31 -0500 Subject: [PATCH] use helper function to check component status --- CRM/Event/Form/ManageEvent/TabHeader.php | 6 +----- CRM/Event/Page/ManageEvent.php | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/CRM/Event/Form/ManageEvent/TabHeader.php b/CRM/Event/Form/ManageEvent/TabHeader.php index 3d8a6b8e72..bd661efae4 100644 --- a/CRM/Event/Form/ManageEvent/TabHeader.php +++ b/CRM/Event/Form/ManageEvent/TabHeader.php @@ -66,12 +66,8 @@ class CRM_Event_Form_ManageEvent_TabHeader { $tabs = []; $tabs['settings'] = ['title' => ts('Info and Settings'), 'class' => 'ajaxForm livePage'] + $default; $tabs['location'] = ['title' => ts('Event Location')] + $default; - // Check to see if CiviContribute is an enabled component. - $components = \Civi\Api4\Setting::get() - ->addSelect('enable_components') - ->execute()[0]['value']; // If CiviContribute is active, create the Fees tab. - if (in_array('CiviContribute', $components)) { + if (CRM_Core_Component::isEnabled('CiviContribute')) { $tabs['fee'] = ['title' => ts('Fees')] + $default; } $tabs['registration'] = ['title' => ts('Online Registration')] + $default; diff --git a/CRM/Event/Page/ManageEvent.php b/CRM/Event/Page/ManageEvent.php index fc1a6f8784..815b8f6ceb 100644 --- a/CRM/Event/Page/ManageEvent.php +++ b/CRM/Event/Page/ManageEvent.php @@ -147,12 +147,8 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page { 'url' => 'civicrm/event/manage/location', 'field' => 'loc_block_id', ]; - // Check to see if CiviContribute is an enabled component. - $components = \Civi\Api4\Setting::get() - ->addSelect('enable_components') - ->execute()[0]['value']; // If CiviContribute is active, create the Fees dropdown menu item. - if (in_array('CiviContribute', $components)) { + if (CRM_Core_Component::isEnabled('CiviContribute')) { self::$_tabLinks[$cacheKey]['fee'] = [ 'title' => ts('Fees'), -- 2.25.1