diff --git a/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php b/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php index f632ebd..46a350d 100644 --- a/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php +++ b/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php @@ -462,10 +462,11 @@ protected function buildLinks(FieldItemListInterface $items) { '#links' => $links, '#attributes' => array('class' => array('links', 'inline')), ); - if ($link_style == static::LINKS_TEASER && $this->moduleHandler->moduleExists('history') && $this->currentUser->isAuthenticated()) { - if ($entity->getEntityTypeId() == 'node') { - $build['comment__' . $field_name]['#attached']['library'][] = 'comment/drupal.node-new-comments-link'; - } + if ($link_style == static::LINKS_TEASER && $this->moduleHandler->moduleExists('history') && $this->currentUser->isAuthenticated() + // @todo revisit this condition when history.module is generalized; + // see https://www.drupal.org/node/2081585. + && $entity->getEntityTypeId() == 'node') { + $build['comment__' . $field_name]['#attached']['library'][] = 'comment/drupal.node-new-comments-link'; // Embed the metadata for the "X new comments" link (if any) on this // node.