diff --git a/core/modules/comment/src/Plugin/Field/FieldFormatter/AuthorNameFormatter.php b/core/modules/comment/src/Plugin/Field/FieldFormatter/AuthorNameFormatter.php index d6d36b4..6772f9b 100644 --- a/core/modules/comment/src/Plugin/Field/FieldFormatter/AuthorNameFormatter.php +++ b/core/modules/comment/src/Plugin/Field/FieldFormatter/AuthorNameFormatter.php @@ -34,7 +34,7 @@ public function viewElements(FieldItemListInterface $items) { foreach ($items as $delta => $item) { /** @var $comment \Drupal\comment\CommentInterface */ $comment = $item->getEntity(); - $account = comment_prepare_author($comment); + $account = $comment->getOwner(); $elements[$delta] = array( '#theme' => 'username', '#account' => $account, diff --git a/core/modules/comment/src/Tests/Views/CommentViewsFieldAccessTest.php b/core/modules/comment/src/Tests/Views/CommentViewsFieldAccessTest.php index eddfe11..34a5882 100644 --- a/core/modules/comment/src/Tests/Views/CommentViewsFieldAccessTest.php +++ b/core/modules/comment/src/Tests/Views/CommentViewsFieldAccessTest.php @@ -69,7 +69,7 @@ public function testCommentFields() { // $this->assertFieldAccess('comment', 'uuid', $comment->uuid()); // $this->assertFieldAccess('comment', 'subject', 'My comment title'); // $this->assertFieldAccess('comment', 'subject', 'Anonymous comment title'); - // $this->assertFieldAccess('comment', 'name', 'anonymous'); + $this->assertFieldAccess('comment', 'name', 'anonymous'); $this->assertFieldAccess('comment', 'mail', 'test@example.com'); $this->assertFieldAccess('comment', 'homepage', 'https://example.com'); // $this->assertFieldAccess('comment', 'uid', $comment->uid->target_id);