diff --git a/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php b/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php index 38a9d08f1a3..967cca87fed 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php +++ b/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php @@ -228,7 +228,7 @@ class CommentViewBuilder extends EntityViewBuilder { if ($entity->access('create')) { $links['comment-reply'] = array( 'title' => t('Reply'), - 'href' => "comment/reply/{$entity->getCommentedEntityId()}/{$entity->getCommentedEntityId()}/{$entity->getFieldName()}/{$entity->id()}", + 'href' => "comment/reply/{$entity->getCommentedEntityTypeId()}/{$entity->getCommentedEntityId()}/{$entity->getFieldName()}/{$entity->id()}", 'html' => TRUE, ); } diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php index a706f74d6d7..d7f8dd05f04 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php @@ -460,6 +460,11 @@ class ForumTest extends WebTestBase { $this->drupalPostForm('node/' . $node->id(), $edit, t('Save')); $this->assertResponse(200); + // Test replying to a comment. + $this->clickLink('Reply'); + $this->assertResponse(200); + $this->assertFieldByName('comment_body[0][value]'); + // Login as the first user. $this->drupalLogin($this->admin_user); // Check that forum renders properly.