X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcomment%2Fsrc%2FCommentViewBuilder.php;h=bac67f1b4868b02ceb5c311742c5084ca4f463f3;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=51a9185853659df3d3123df4705c159812e1dc20;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;p=yaffs-website diff --git a/web/core/modules/comment/src/CommentViewBuilder.php b/web/core/modules/comment/src/CommentViewBuilder.php index 51a918585..bac67f1b4 100644 --- a/web/core/modules/comment/src/CommentViewBuilder.php +++ b/web/core/modules/comment/src/CommentViewBuilder.php @@ -98,6 +98,7 @@ class CommentViewBuilder extends EntityViewBuilder { // A counter to track the indentation level. $current_indent = 0; + $attach_history = $this->moduleHandler->moduleExists('history') && $this->currentUser->isAuthenticated(); foreach ($entities as $id => $entity) { if ($build[$id]['#comment_threaded']) { @@ -143,7 +144,7 @@ class CommentViewBuilder extends EntityViewBuilder { $build[$id]['#attached'] = []; } $build[$id]['#attached']['library'][] = 'comment/drupal.comment-by-viewer'; - if ($this->moduleHandler->moduleExists('history') && $this->currentUser->isAuthenticated()) { + if ($attach_history && $commented_entity->getEntityTypeId() === 'node') { $build[$id]['#attached']['library'][] = 'comment/drupal.comment-new-indicator'; // Embed the metadata for the comment "new" indicators on this node.