diff --git a/CRM/Event/ActionMapping.php b/CRM/Event/ActionMapping.php index c474a8dba6aaf87b5afd7ffaf7a5533fd66bdebd..a14785f48b1eb72d338307b630c435692fcc235c 100644 --- a/CRM/Event/ActionMapping.php +++ b/CRM/Event/ActionMapping.php @@ -37,6 +37,9 @@ class CRM_Event_ActionMapping extends \Civi\ActionSchedule\Mapping { * @param \Civi\ActionSchedule\Event\MappingRegisterEvent $registrations */ public static function onRegisterActionMappings(\Civi\ActionSchedule\Event\MappingRegisterEvent $registrations) { + if (!CRM_Core_Component::isEnabled('CiviEvent')) { + return; + } $registrations->register(CRM_Event_ActionMapping::create([ 'id' => CRM_Event_ActionMapping::EVENT_TYPE_MAPPING_ID, 'entity' => 'civicrm_participant', diff --git a/Civi/ActionSchedule/Mapping.php b/Civi/ActionSchedule/Mapping.php index 2c092ddcea2e1f22619be7db95f8e6af456920f5..6032dcf103185238e58e6dffdf2fe63f745679ad 100644 --- a/Civi/ActionSchedule/Mapping.php +++ b/Civi/ActionSchedule/Mapping.php @@ -275,15 +275,17 @@ abstract class Mapping implements MappingInterface { asort($valueLabelMap['activity_type']); $valueLabelMap['activity_status'] = \CRM_Core_PseudoConstant::activityStatus(); - $valueLabelMap['event_type'] = \CRM_Event_PseudoConstant::eventType(); - $valueLabelMap['civicrm_event'] = \CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )"); - $valueLabelMap['civicrm_participant_status_type'] = \CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label'); - $valueLabelMap['event_template'] = \Civi\Api4\Event::get(FALSE) - ->addWhere('is_template', '=', TRUE) - ->addWhere('is_active', '=', TRUE) - ->execute() - ->indexBy('id') - ->column('template_title'); + if (\CRM_Core_Component::isEnabled('CiviEvent')) { + $valueLabelMap['event_type'] = \CRM_Event_PseudoConstant::eventType(); + $valueLabelMap['civicrm_event'] = \CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )"); + $valueLabelMap['civicrm_participant_status_type'] = \CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label'); + $valueLabelMap['event_template'] = \Civi\Api4\Event::get(FALSE) + ->addWhere('is_template', '=', TRUE) + ->addWhere('is_active', '=', TRUE) + ->execute() + ->indexBy('id') + ->column('template_title'); + } $valueLabelMap['auto_renew_options'] = \CRM_Core_OptionGroup::values('auto_renew_options'); $valueLabelMap['contact_date_reminder_options'] = \CRM_Core_OptionGroup::values('contact_date_reminder_options'); $valueLabelMap['civicrm_membership_type'] = \CRM_Member_PseudoConstant::membershipType();