From 45fb1308e7fbec3f55f18ee2fbee2878e074fee7 Mon Sep 17 00:00:00 2001 From: Liam Morland Date: Thu, 23 Sep 2021 15:22:09 -0400 Subject: [PATCH] ISTWCMS-4885: Add locations pre-fill menu to event edit and clone pages They previously appeared only on event creation pages. Fixes bug introduced in 9510b69. --- uw_ct_event.module | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/uw_ct_event.module b/uw_ct_event.module index 2c23846..36ced5c 100644 --- a/uw_ct_event.module +++ b/uw_ct_event.module @@ -226,3 +226,15 @@ function uw_ct_event_form_node_uw_ct_event_form_alter(array &$form, FormStateInt $form['#attached']['library'][] = 'uw_ct_event/location_autofill'; $form['#attached']['drupalSettings']['uwCtEvent'] = _uw_ct_event_load_locations(); } + +/** + * Implements hook_form_alter(). + */ +function uw_ct_event_form_alter(array &$form, FormStateInterface $form_state, string $form_id): void { + switch ($form_id) { + case 'node_uw_ct_event_edit_form': + case 'node_uw_ct_event_quick_node_clone_form': + uw_ct_event_form_node_uw_ct_event_form_alter($form, $form_state, $form_id); + break; + } +} -- GitLab