X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcomment%2Fsrc%2FCommentViewBuilder.php;fp=web%2Fcore%2Fmodules%2Fcomment%2Fsrc%2FCommentViewBuilder.php;h=bac67f1b4868b02ceb5c311742c5084ca4f463f3;hp=51a9185853659df3d3123df4705c159812e1dc20;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c 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.