diff --git a/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php b/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php index 38a9d08f1a3092bf53e3d0a84a3994b8e4c63f4a..967cca87fed527879ce8ca74908ce12a54c03da0 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php +++ b/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php @@ -228,7 +228,7 @@ protected static function buildLinks(CommentInterface $entity, EntityInterface $ 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 a706f74d6d7822536ab63d00fae16e5c45961567..d7f8dd05f04996edd02ed14d9f887902f21bc259 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 @@ function testForumWithNewPost() { $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.