From bd1399448f37199ca33248a9e43d1c730c03e61c Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Sat, 20 Jun 2015 15:32:01 -0500 Subject: [PATCH] Issue #2505835 by andypost: Optimize CommentAdminOverview --- .../modules/comment/src/Form/CommentAdminOverview.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/modules/comment/src/Form/CommentAdminOverview.php b/core/modules/comment/src/Form/CommentAdminOverview.php index 008e0bbef38c..16c86c1f22a5 100644 --- a/core/modules/comment/src/Form/CommentAdminOverview.php +++ b/core/modules/comment/src/Form/CommentAdminOverview.php @@ -183,10 +183,6 @@ class CommentAdminOverview extends FormBase { foreach ($comments as $comment) { /** @var $commented_entity \Drupal\Core\Entity\EntityInterface */ $commented_entity = $commented_entities[$comment->getCommentedEntityTypeId()][$comment->getCommentedEntityId()]; - $username = array( - '#theme' => 'username', - '#account' => $comment->getOwner(), - ); $body = ''; if (!empty($comment->comment_body->value)) { $body = $comment->comment_body->value; @@ -204,7 +200,12 @@ class CommentAdminOverview extends FormBase { '#url' => $comment_permalink, ), ), - 'author' => drupal_render($username), + 'author' => array( + 'data' => array( + '#theme' => 'username', + '#account' => $comment->getOwner(), + ), + ), 'posted_in' => array( 'data' => array( '#type' => 'link',