diff --git a/core/modules/comment/src/Tests/CommentLinksTest.php b/core/modules/comment/src/Tests/CommentLinksTest.php index 2d37136..7693fb8 100644 --- a/core/modules/comment/src/Tests/CommentLinksTest.php +++ b/core/modules/comment/src/Tests/CommentLinksTest.php @@ -104,6 +104,20 @@ public function testCommentLinks() { $this->assertLink('Add new comment'); } + // Change weight to make links go before comment body. + entity_get_display('comment', 'comment', 'default') + ->setComponent('links', array('weight' => -100)) + ->save(); + $this->drupalGet($this->node->urlInfo()); + $this->assertTrue($this->cssSelect('article > div ul:first-child'), 'Links found before comment body.'); + + // Change weight to make links go after comment body. + entity_get_display('comment', 'comment', 'default') + ->setComponent('links', array('weight' => 100)) + ->save(); + $this->drupalGet($this->node->urlInfo()); + $this->assertTrue($this->cssSelect('article > div ul:last-child'), 'Links found after comment body.'); + // Make sure we can hide node links. entity_get_display('node', $this->node->bundle(), 'default') ->removeComponent('links') diff --git a/core/modules/comment/templates/comment.html.twig b/core/modules/comment/templates/comment.html.twig index 75604b9..419b9c7 100644 --- a/core/modules/comment/templates/comment.html.twig +++ b/core/modules/comment/templates/comment.html.twig @@ -102,7 +102,7 @@ - {{ content|without('links') }} + {{ content }} {% if signature %}
@@ -110,7 +110,4 @@
{% endif %} - {% if content.links %} - {{ content.links }} - {% endif %} diff --git a/core/themes/bartik/templates/comment.html.twig b/core/themes/bartik/templates/comment.html.twig index 1d6718d..95ef8fe 100644 --- a/core/themes/bartik/templates/comment.html.twig +++ b/core/themes/bartik/templates/comment.html.twig @@ -105,15 +105,12 @@ {{ title_suffix }} {% endif %} - {{ content|without('links') }} + {{ content }} -
- {% if signature %} + {% if signature %} +
{{ signature }}
- {% endif %} - {% if content.links %} - - {% endif %} -
+
+ {% endif %} diff --git a/core/themes/classy/templates/content/comment.html.twig b/core/themes/classy/templates/content/comment.html.twig index ba62e2b..745a752 100644 --- a/core/themes/classy/templates/content/comment.html.twig +++ b/core/themes/classy/templates/content/comment.html.twig @@ -110,7 +110,7 @@ - {{ content|without('links') }} + {{ content }} {% if signature %}
@@ -118,7 +118,4 @@
{% endif %} - {% if content.links %} - {{ content.links }} - {% endif %}