diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 1dd07e3..64bd59b 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1530,7 +1530,7 @@ function template_preprocess_field(&$variables, $hook) { } // Merge attributes when a single-value field has a visible label. if ($element['#label_display'] != 'hidden' && !$variables['multiple'] && is_object($element['#items'][0])) { - $variables['content_attributes'] = NestedArray::mergeDeep($variables['content_attributes'], (array) $element['#items'][0]->_attributes); + $element['#items'][0]->_attributes = NestedArray::mergeDeep($variables['content_attributes'], (array) $element['#items'][0]->_attributes); } // We want other preprocess functions and the theme implementation to have diff --git a/core/modules/rdf/src/Tests/CommentAttributesTest.php b/core/modules/rdf/src/Tests/CommentAttributesTest.php index e678de2..c3d0811 100644 --- a/core/modules/rdf/src/Tests/CommentAttributesTest.php +++ b/core/modules/rdf/src/Tests/CommentAttributesTest.php @@ -279,7 +279,7 @@ function _testBasicCommentRdfaMarkup($graph, CommentInterface $comment, $account // Comment body. $expected_value = array( 'type' => 'literal', - 'value' => $comment->comment_body->value . "\n", + 'value' => $comment->comment_body->value, 'lang' => 'en', ); $this->assertTrue($graph->hasProperty($comment_uri, 'http://purl.org/rss/1.0/modules/content/encoded', $expected_value), 'Comment body found in RDF output (content:encoded).'); diff --git a/core/modules/system/src/Tests/Entity/EntityViewControllerTest.php b/core/modules/system/src/Tests/Entity/EntityViewControllerTest.php index a80b984..533b0ba 100644 --- a/core/modules/system/src/Tests/Entity/EntityViewControllerTest.php +++ b/core/modules/system/src/Tests/Entity/EntityViewControllerTest.php @@ -47,8 +47,7 @@ protected function setUp() { function testEntityViewController() { $get_label_markup = function($label) { return '

-
' . $label . '
-

'; +
' . $label . '
'; }; foreach ($this->entities as $entity) { diff --git a/core/modules/system/templates/field.html.twig b/core/modules/system/templates/field.html.twig index 248dd8e..a2fe7d0 100644 --- a/core/modules/system/templates/field.html.twig +++ b/core/modules/system/templates/field.html.twig @@ -56,14 +56,12 @@ {{ label }}: {% if multiple %} - {% for item in items %} - {{ item.content }} - {% endfor %} + {% endif %} + {% for item in items %} + {{ item.content }} + {% endfor %} + {% if multiple %} - {% else %} - {% for item in items %} - {{ item.content }} - {% endfor %} {% endif %} {% endif %} diff --git a/core/themes/classy/templates/field/field.html.twig b/core/themes/classy/templates/field/field.html.twig index 29c2b97..38b2855 100644 --- a/core/themes/classy/templates/field/field.html.twig +++ b/core/themes/classy/templates/field/field.html.twig @@ -71,14 +71,12 @@ {{ label }}: {% if multiple %} - {% for item in items %} - {{ item.content }} - {% endfor %} + {% endif %} + {% for item in items %} + {{ item.content }} + {% endfor %} + {% if multiple %} - {% else %} - {% for item in items %} - {{ item.content }} - {% endfor %} {% endif %} {% endif %}