From 4b79f51c67e9c0304c8ced51432da9f0fc0d1b2a Mon Sep 17 00:00:00 2001 From: Brienne Kordis Date: Tue, 6 Dec 2022 14:24:02 -0500 Subject: [PATCH] conditionally hide Fees drop down item --- CRM/Event/Page/ManageEvent.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/CRM/Event/Page/ManageEvent.php b/CRM/Event/Page/ManageEvent.php index 57a620ec1b..fc1a6f8784 100644 --- a/CRM/Event/Page/ManageEvent.php +++ b/CRM/Event/Page/ManageEvent.php @@ -147,13 +147,20 @@ 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)) { + self::$_tabLinks[$cacheKey]['fee'] + = [ + 'title' => ts('Fees'), + 'url' => 'civicrm/event/manage/fee', + 'field' => 'is_monetary', + ]; + } - self::$_tabLinks[$cacheKey]['fee'] - = [ - 'title' => ts('Fees'), - 'url' => 'civicrm/event/manage/fee', - 'field' => 'is_monetary', - ]; self::$_tabLinks[$cacheKey]['registration'] = [ 'title' => ts('Online Registration'), -- 2.25.1