diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 0e78559..f180cbd 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -568,11 +568,9 @@ function template_preprocess_datetime_form(&$variables) { */ function template_preprocess_datetime_wrapper(&$variables) { $element = $variables['element']; - $element['#title_display'] = isset($element['#title_display']) ? $element['#title_display'] : 'before'; if (!empty($element['#title'])) { $variables['title'] = $element['#title']; - $variables['title_display'] = $element['#title_display']; } // Suppress error messages. diff --git a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeWidgetBase.php b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeWidgetBase.php index 240e4c5..aa6175a 100644 --- a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeWidgetBase.php +++ b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeWidgetBase.php @@ -23,6 +23,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen // title because the actual title display is handled at a higher level by // the Field module. + $element['#theme_wrappers'][] = 'datetime_wrapper'; $element['#attributes']['class'][] = 'container-inline'; $element['value'] = array( @@ -31,8 +32,6 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen '#date_increment' => 1, '#date_timezone' => drupal_get_user_timezone(), '#required' => $element['#required'], - '#title' => $element['#title'], - '#title_display' => 'invisible', ); if ($this->getFieldSetting('datetime_type') == DateTimeItem::DATETIME_TYPE_DATE) { diff --git a/core/modules/system/templates/datetime-wrapper.html.twig b/core/modules/system/templates/datetime-wrapper.html.twig index 5258361..8430baa 100644 --- a/core/modules/system/templates/datetime-wrapper.html.twig +++ b/core/modules/system/templates/datetime-wrapper.html.twig @@ -19,7 +19,6 @@ set title_classes = [ required ? 'js-form-required', required ? 'form-required', - title_display == 'invisible' ? 'visually-hidden' ] %} {% if title %} diff --git a/core/themes/classy/templates/form/datetime-wrapper.html.twig b/core/themes/classy/templates/form/datetime-wrapper.html.twig index efd06e0..3f6aa59 100644 --- a/core/themes/classy/templates/form/datetime-wrapper.html.twig +++ b/core/themes/classy/templates/form/datetime-wrapper.html.twig @@ -18,7 +18,6 @@ 'label', required ? 'js-form-required', required ? 'form-required', - title_display == 'invisible' ? 'visually-hidden' ] %} {% if title %} diff --git a/core/themes/stable/templates/form/datetime-wrapper.html.twig b/core/themes/stable/templates/form/datetime-wrapper.html.twig index cff8d8f..3c37ffd 100644 --- a/core/themes/stable/templates/form/datetime-wrapper.html.twig +++ b/core/themes/stable/templates/form/datetime-wrapper.html.twig @@ -17,7 +17,6 @@ set title_classes = [ required ? 'js-form-required', required ? 'form-required', - title_display == 'invisible' ? 'visually-hidden' ] %} {% if title %}