Issue #2505835 by andypost: Optimize CommentAdminOverview
parent
6dc5310a30
commit
bd1399448f
|
@ -183,10 +183,6 @@ class CommentAdminOverview extends FormBase {
|
||||||
foreach ($comments as $comment) {
|
foreach ($comments as $comment) {
|
||||||
/** @var $commented_entity \Drupal\Core\Entity\EntityInterface */
|
/** @var $commented_entity \Drupal\Core\Entity\EntityInterface */
|
||||||
$commented_entity = $commented_entities[$comment->getCommentedEntityTypeId()][$comment->getCommentedEntityId()];
|
$commented_entity = $commented_entities[$comment->getCommentedEntityTypeId()][$comment->getCommentedEntityId()];
|
||||||
$username = array(
|
|
||||||
'#theme' => 'username',
|
|
||||||
'#account' => $comment->getOwner(),
|
|
||||||
);
|
|
||||||
$body = '';
|
$body = '';
|
||||||
if (!empty($comment->comment_body->value)) {
|
if (!empty($comment->comment_body->value)) {
|
||||||
$body = $comment->comment_body->value;
|
$body = $comment->comment_body->value;
|
||||||
|
@ -204,7 +200,12 @@ class CommentAdminOverview extends FormBase {
|
||||||
'#url' => $comment_permalink,
|
'#url' => $comment_permalink,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'author' => drupal_render($username),
|
'author' => array(
|
||||||
|
'data' => array(
|
||||||
|
'#theme' => 'username',
|
||||||
|
'#account' => $comment->getOwner(),
|
||||||
|
),
|
||||||
|
),
|
||||||
'posted_in' => array(
|
'posted_in' => array(
|
||||||
'data' => array(
|
'data' => array(
|
||||||
'#type' => 'link',
|
'#type' => 'link',
|
||||||
|
|
Loading…
Reference in New Issue