Skip to content
Snippets Groups Projects
Commit 113ebf52 authored by Eileen McNaughton's avatar Eileen McNaughton
Browse files

#4145 Prevent fatal on event sched reminders when CiviEvent enabled

parent 7e4c4583
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,9 @@ class CRM_Event_ActionMapping extends \Civi\ActionSchedule\Mapping { ...@@ -37,6 +37,9 @@ class CRM_Event_ActionMapping extends \Civi\ActionSchedule\Mapping {
* @param \Civi\ActionSchedule\Event\MappingRegisterEvent $registrations * @param \Civi\ActionSchedule\Event\MappingRegisterEvent $registrations
*/ */
public static function onRegisterActionMappings(\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([ $registrations->register(CRM_Event_ActionMapping::create([
'id' => CRM_Event_ActionMapping::EVENT_TYPE_MAPPING_ID, 'id' => CRM_Event_ActionMapping::EVENT_TYPE_MAPPING_ID,
'entity' => 'civicrm_participant', 'entity' => 'civicrm_participant',
......
...@@ -275,15 +275,17 @@ abstract class Mapping implements MappingInterface { ...@@ -275,15 +275,17 @@ abstract class Mapping implements MappingInterface {
asort($valueLabelMap['activity_type']); asort($valueLabelMap['activity_type']);
$valueLabelMap['activity_status'] = \CRM_Core_PseudoConstant::activityStatus(); $valueLabelMap['activity_status'] = \CRM_Core_PseudoConstant::activityStatus();
$valueLabelMap['event_type'] = \CRM_Event_PseudoConstant::eventType(); if (\CRM_Core_Component::isEnabled('CiviEvent')) {
$valueLabelMap['civicrm_event'] = \CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )"); $valueLabelMap['event_type'] = \CRM_Event_PseudoConstant::eventType();
$valueLabelMap['civicrm_participant_status_type'] = \CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label'); $valueLabelMap['civicrm_event'] = \CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
$valueLabelMap['event_template'] = \Civi\Api4\Event::get(FALSE) $valueLabelMap['civicrm_participant_status_type'] = \CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label');
->addWhere('is_template', '=', TRUE) $valueLabelMap['event_template'] = \Civi\Api4\Event::get(FALSE)
->addWhere('is_active', '=', TRUE) ->addWhere('is_template', '=', TRUE)
->execute() ->addWhere('is_active', '=', TRUE)
->indexBy('id') ->execute()
->column('template_title'); ->indexBy('id')
->column('template_title');
}
$valueLabelMap['auto_renew_options'] = \CRM_Core_OptionGroup::values('auto_renew_options'); $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['contact_date_reminder_options'] = \CRM_Core_OptionGroup::values('contact_date_reminder_options');
$valueLabelMap['civicrm_membership_type'] = \CRM_Member_PseudoConstant::membershipType(); $valueLabelMap['civicrm_membership_type'] = \CRM_Member_PseudoConstant::membershipType();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment