From 991bb0856b42857400e3ea1ffdfcba7a64e5feb6 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Tue, 19 Jan 2016 14:22:33 +0000
Subject: [PATCH] Issue #2526064 by Mile23, naveenvalecha: Remove usage of
 comment_view() & comment_view_multiple()

---
 core/modules/comment/comment.module               | 4 ++--
 core/modules/comment/src/Plugin/views/row/Rss.php | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index e333b565add8..e1d74b6a4709 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -563,7 +563,7 @@ function comment_preview(CommentInterface $comment, FormStateInterface $form_sta
 
   if (!$form_state->getErrors()) {
     $comment->in_preview = TRUE;
-    $comment_build = comment_view($comment);
+    $comment_build = \Drupal::entityTypeManager()->getViewBuilder('comment')->view($comment);
     $comment_build['#weight'] = -100;
 
     $preview_build['comment_preview'] = $comment_build;
@@ -573,7 +573,7 @@ function comment_preview(CommentInterface $comment, FormStateInterface $form_sta
     $build = array();
     $parent = $comment->getParentComment();
     if ($parent && $parent->isPublished()) {
-      $build = comment_view($parent);
+      $build = \Drupal::entityTypeManager()->getViewBuilder('comment')->view($parent);
     }
   }
   else {
diff --git a/core/modules/comment/src/Plugin/views/row/Rss.php b/core/modules/comment/src/Plugin/views/row/Rss.php
index f4e62c72ec17..df7200ff4f09 100644
--- a/core/modules/comment/src/Plugin/views/row/Rss.php
+++ b/core/modules/comment/src/Plugin/views/row/Rss.php
@@ -104,7 +104,7 @@ public function render($row) {
 
     // The comment gets built and modules add to or modify
     // $comment->rss_elements and $comment->rss_namespaces.
-    $build = comment_view($comment, 'rss');
+    $build = $this->entityManager->getViewBuilder('comment')->view($comment, 'rss');
     unset($build['#theme']);
 
     if (!empty($comment->rss_namespaces)) {
-- 
GitLab