Commit bd139944 authored by alexpott's avatar alexpott
Browse files

Issue #2505835 by andypost: Optimize CommentAdminOverview

parent 6dc5310a
......@@ -183,10 +183,6 @@ public function buildForm(array $form, FormStateInterface $form_state, $type = '
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 @@ public function buildForm(array $form, FormStateInterface $form_state, $type = '
'#url' => $comment_permalink,
),
),
'author' => drupal_render($username),
'author' => array(
'data' => array(
'#theme' => 'username',
'#account' => $comment->getOwner(),
),
),
'posted_in' => array(
'data' => array(
'#type' => 'link',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment