diff --git a/core/modules/book/book.module b/core/modules/book/book.module index f55f5d6fd7e0..f9a6ad21a14e 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -88,7 +88,7 @@ function book_entity_type_build(array &$entity_types) { /** * Implements hook_node_links_alter(). */ -function book_node_links_alter(array &$node_links, NodeInterface $node, array &$context) { +function book_node_links_alter(array &$links, NodeInterface $node, array &$context) { if ($context['view_mode'] != 'rss') { $account = \Drupal::currentUser(); @@ -97,14 +97,14 @@ function book_node_links_alter(array &$node_links, NodeInterface $node, array &$ $child_type = \Drupal::config('book.settings')->get('child_type'); $access_control_handler = \Drupal::entityManager()->getAccessControlHandler('node'); if (($account->hasPermission('add content to books') || $account->hasPermission('administer book outlines')) && $access_control_handler->createAccess($child_type) && $node->isPublished() && $node->book['depth'] < BookManager::BOOK_MAX_DEPTH) { - $links['book_add_child'] = array( + $book_links['book_add_child'] = array( 'title' => t('Add child page'), 'url' => Url::fromRoute('node.add', ['node_type' => $child_type], ['query' => ['parent' => $node->id()]]), ); } if ($account->hasPermission('access printer-friendly version')) { - $links['book_printer'] = array( + $book_links['book_printer'] = array( 'title' => t('Printer-friendly version'), 'url' => Url::fromRoute('book.export', [ 'type' => 'html', @@ -116,10 +116,10 @@ function book_node_links_alter(array &$node_links, NodeInterface $node, array &$ } } - if (!empty($links)) { - $node_links['book'] = array( + if (!empty($book_links)) { + $links['book'] = array( '#theme' => 'links__node__book', - '#links' => $links, + '#links' => $book_links, '#attributes' => array('class' => array('links', 'inline')), ); } diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index e1d74b6a4709..8736b901b7ab 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -194,15 +194,15 @@ function comment_field_config_delete(FieldConfigInterface $field) { /** * Implements hook_node_links_alter(). */ -function comment_node_links_alter(array &$node_links, NodeInterface $node, array &$context) { +function comment_node_links_alter(array &$links, NodeInterface $node, array &$context) { // Comment links are only added to node entity type for backwards // compatibility. Should you require comment links for other entity types you // can do so by implementing a new field formatter. // @todo Make this configurable from the formatter. See // https://www.drupal.org/node/1901110. - $links = \Drupal::service('comment.link_builder')->buildCommentedEntityLinks($node, $context); - $node_links += $links; + $comment_links = \Drupal::service('comment.link_builder')->buildCommentedEntityLinks($node, $context); + $links += $comment_links; } /** diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module index 61d58e291984..5079e43cb322 100644 --- a/core/modules/statistics/statistics.module +++ b/core/modules/statistics/statistics.module @@ -48,20 +48,20 @@ function statistics_node_view(array &$build, EntityInterface $node, EntityViewDi /** * Implements hook_node_links_alter(). */ -function statistics_node_links_alter(array &$node_links, NodeInterface $entity, array &$context) { +function statistics_node_links_alter(array &$links, NodeInterface $entity, array &$context) { if ($context['view_mode'] != 'rss') { - $node_links['#cache']['contexts'][] = 'user.permissions'; + $links['#cache']['contexts'][] = 'user.permissions'; if (\Drupal::currentUser()->hasPermission('view post access counter')) { $statistics = statistics_get($entity->id()); if ($statistics) { - $links['statistics_counter']['title'] = \Drupal::translation()->formatPlural($statistics['totalcount'], '1 view', '@count views'); - $node_links['statistics'] = array( + $statistics_links['statistics_counter']['title'] = \Drupal::translation()->formatPlural($statistics['totalcount'], '1 view', '@count views'); + $links['statistics'] = array( '#theme' => 'links__node__statistics', - '#links' => $links, + '#links' => $statistics_links, '#attributes' => array('class' => array('links', 'inline')), ); } - $node_links['#cache']['max-age'] = \Drupal::config('statistics.settings')->get('display_max_age'); + $links['#cache']['max-age'] = \Drupal::config('statistics.settings')->get('display_max_age'); } } }