use helper function to check component status
authorBrienne Kordis <brienne@megaphonetech.com>
Mon, 12 Dec 2022 21:03:31 +0000 (16:03 -0500)
committerBrienne Kordis <brienne@megaphonetech.com>
Mon, 12 Dec 2022 21:03:31 +0000 (16:03 -0500)
CRM/Event/Form/ManageEvent/TabHeader.php
CRM/Event/Page/ManageEvent.php

index 3d8a6b8e727bb60fce069cc408b39a823ed94236..bd661efae4d781ef50c7a7841ca17d73497a4629 100644 (file)
@@ -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;
index fc1a6f878470c651bd7c6926d4a6ff524ac75472..815b8f6ceb24dceef0e20ed491c4cfe618a3b9cf 100644 (file)
@@ -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'),