diff --git a/label_help.module b/label_help.module index 6aa815f784ac2732ff6c71c5a50394cbe0a644f4..44448364df8da1b786933cbf014e58232ab97d0e 100644 --- a/label_help.module +++ b/label_help.module @@ -135,14 +135,16 @@ function label_help_form_alter(&$form, &$form_state, $form_id) { } } - // Special case for checkboxes and radios. Drupal's fieldset.html.twig do - // not support the #label_prefix, so use #field_prefix instead, but be - // careful to not overwrite content when the #field_prefix is already - // defined. + // Special case for media, checkboxes and radios where Drupal's + // fieldset.html.twig does not support the #label_prefix, so use + // #field_prefix instead, but be careful to not overwrite content + // when the #field_prefix is already defined. elseif ( ( !empty($item['widget']['#type']) && + !empty($item['widget']['#title']) && ( + $item['widget']['#type'] == 'fieldset' || $item['widget']['#type'] == 'checkboxes' || $item['widget']['#type'] == 'radios' )