diff --git a/web/modules/custom/dpl_event/dpl_event.module b/web/modules/custom/dpl_event/dpl_event.module index 89ff8f4bd..b779fcc14 100644 --- a/web/modules/custom/dpl_event/dpl_event.module +++ b/web/modules/custom/dpl_event/dpl_event.module @@ -313,11 +313,19 @@ function dpl_event_form_alter(array &$form, FormStateInterface $form_state, stri return; } - if (\Drupal::config(SettingsForm::CONFIG_NAME)->get('enable_screen_name')) { + if (!isset($form['field_screen_names'])) { return; } - if (isset($form['field_screen_names'])) { - $form['field_screen_names']['#access'] = FALSE; + // Undo select2s adding of help text. + if (isset($form['field_screen_names']['widget']['#description']['#items'])) { + $form['field_screen_names']['widget']['#description'] = + $form['field_screen_names']['widget']['#description']['#items'][0]; + } + + if (\Drupal::config(SettingsForm::CONFIG_NAME)->get('enable_screen_name')) { + return; } + + $form['field_screen_names']['#access'] = FALSE; }