diff --git a/core/modules/comment/src/CommentLinkBuilder.php b/core/modules/comment/src/CommentLinkBuilder.php index d57ad85..363aff6 100644 --- a/core/modules/comment/src/CommentLinkBuilder.php +++ b/core/modules/comment/src/CommentLinkBuilder.php @@ -66,7 +66,7 @@ public function __construct(AccountProxyInterface $current_user, CommentManagerI /** * {@inheritdoc} */ - public function buildLinks(array &$links, ContentEntityInterface $entity, array &$context) { + public function buildLinks(array &$entity_links, ContentEntityInterface $entity, array &$context) { $view_mode = $context['view_mode']; if ($view_mode == 'search_index' || $view_mode == 'search_result' || $view_mode == 'print') { // Do not add any links if the node displayed for: @@ -194,20 +194,20 @@ public function buildLinks(array &$links, ContentEntityInterface $entity, array } if (!empty($links)) { - $links['comment__' . $field_name] = array( + $entity_links['comment__' . $field_name] = array( '#theme' => 'links__entity__comment__' . $field_name, '#links' => $links, '#attributes' => array('class' => array('links', 'inline')), ); if ($view_mode == 'teaser' && $this->moduleHandler->moduleExists('history') && $this->currentUser->isAuthenticated()) { - $links['comment__' . $field_name]['#attached']['library'][] = 'comment/drupal.node-new-comments-link'; + $entity_links['comment__' . $field_name]['#attached']['library'][] = 'comment/drupal.node-new-comments-link'; // Embed the metadata for the "X new comments" link (if any) on this // entity. - $links['comment__' . $field_name]['#post_render_cache']['history_attach_timestamp'] = array( + $entity_links['comment__' . $field_name]['#post_render_cache']['history_attach_timestamp'] = array( array('node_id' => $entity->id()), ); - $links['comment__' . $field_name]['#post_render_cache']['Drupal\comment\CommentViewBuilder::attachNewCommentsLinkMetadata'] = array( + $entity_links['comment__' . $field_name]['#post_render_cache']['Drupal\comment\CommentViewBuilder::attachNewCommentsLinkMetadata'] = array( array( 'entity_type' => $entity->getEntityTypeId(), 'entity_id' => $entity->id(), diff --git a/core/modules/comment/src/CommentLinkBuilderInterface.php b/core/modules/comment/src/CommentLinkBuilderInterface.php index 8aa4571..8acb582 100644 --- a/core/modules/comment/src/CommentLinkBuilderInterface.php +++ b/core/modules/comment/src/CommentLinkBuilderInterface.php @@ -19,13 +19,13 @@ /** * Builds links for the given entity. * - * @param array $links + * @param array $entity_links * Array of existing links keyed by link ID. * @param \Drupal\Core\Entity\ContentEntityInterface $entity * Entity for which the links are being built. * @param array $context * Array of context passed from the entity view builder. */ - public function buildLinks(array &$links, ContentEntityInterface $entity, array &$context); + public function buildLinks(array &$entity_links, ContentEntityInterface $entity, array &$context); }