Skip to content
Snippets Groups Projects
Commit 783db6db authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2301599 by Cottser, mparker17: Fixed Regression: Bartik's...

Issue #2301599 by Cottser, mparker17: Fixed Regression: Bartik's field--taxonomy-term-reference.html.twig doesn't properly output label attributes.
parent 883577b6
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -159,7 +159,7 @@ function bartik_menu_tree__shortcut_default($variables) { ...@@ -159,7 +159,7 @@ function bartik_menu_tree__shortcut_default($variables) {
function bartik_preprocess_field(&$variables) { function bartik_preprocess_field(&$variables) {
$element = $variables['element']; $element = $variables['element'];
if ($element['#field_type'] == 'taxonomy_term_reference') { if ($element['#field_type'] == 'taxonomy_term_reference') {
$variables['title_attributes']['class'][] = array('field-label'); $variables['title_attributes']['class'][] = 'field-label';
if ($variables['element']['#label_display'] == 'inline') { if ($variables['element']['#label_display'] == 'inline') {
$variables['title_attributes']['class'][] = 'inline'; $variables['title_attributes']['class'][] = 'inline';
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Available variables: * Available variables:
* - attributes: HTML attributes for the containing element. * - attributes: HTML attributes for the containing element.
* - label_hidden: Whether the field label has been set to hidden. * - label_hidden: Whether the field label has been set to hidden.
* - label_attributes: HTML attributes for the label. * - title_attributes: HTML attributes for the label.
* - label: The label for the field. * - label: The label for the field.
* - content_attributes: HTML attributes for the content. * - content_attributes: HTML attributes for the content.
* - items: List of all the field items. * - items: List of all the field items.
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#} #}
<div class="{{ attributes.class }} clearfix"{{ attributes|without('class') }}> <div class="{{ attributes.class }} clearfix"{{ attributes|without('class') }}>
{% if not label_hidden %} {% if not label_hidden %}
<h3{{ label_attributes }}>{{ label }}: </h3> <h3{{ title_attributes }}>{{ label }}: </h3>
{% endif %} {% endif %}
<ul class="links"> <ul class="links">
{% for delta, item in items %} {% for delta, item in items %}
......
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