diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 60d2c1b..68acd32 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1270,7 +1270,7 @@ function comment_load($cid, $reset = FALSE) { * The number of new comments or FALSE if the user is not logged in. */ function comment_num_new($entity_id, $entity_type, $field_name = NULL, $timestamp = 0) { - return \Drupal::service('comment.manager')->getCountNewComments($entity_id, $entity_type, $field_name, $timestamp); + return \Drupal::service('comment.manager')->getCountNewComments($entity_type, $entity_id, $field_name, $timestamp); } /** diff --git a/core/modules/comment/comment.tokens.inc b/core/modules/comment/comment.tokens.inc index 5a5ca97..1b4d584 100644 --- a/core/modules/comment/comment.tokens.inc +++ b/core/modules/comment/comment.tokens.inc @@ -266,7 +266,7 @@ function comment_tokens($type, $tokens, array $data = array(), array $options = break; case 'comment-count-new': - $replacements[$original] = \Drupal::service('comment.manager')->getCountNewComments($entity->id(), $entity->entityType()); + $replacements[$original] = \Drupal::service('comment.manager')->getCountNewComments($entity->entityType(), $entity->id()); break; } } diff --git a/core/modules/comment/lib/Drupal/comment/CommentManager.php b/core/modules/comment/lib/Drupal/comment/CommentManager.php index c616d32..f6341fb 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentManager.php +++ b/core/modules/comment/lib/Drupal/comment/CommentManager.php @@ -263,10 +263,10 @@ public function getFieldUIPageTitle($field_name) { /** * Returns the number of new comments for an user and the specified entity. * - * @param int $entity_id - * Entity ID of the entity to which the comments are attached. * @param string $entity_type * Entity type of the entity to which the comments are attached. + * @param int $entity_id + * Entity ID of the entity to which the comments are attached. * @param string $field_name * (optional) The field_name to count comments for. Defaults to NULL. * @param int $timestamp @@ -277,7 +277,7 @@ public function getFieldUIPageTitle($field_name) { * @return int|FALSE * The number of new comments or FALSE if the user is not logged in. */ - public function getCountNewComments($entity_id, $entity_type, $field_name = NULL, $timestamp = 0, AccountInterface $account = NULL) { + public function getCountNewComments($entity_type, $entity_id, $field_name = NULL, $timestamp = 0, AccountInterface $account = NULL) { if (!isset($account)) { $account = \Drupal::currentUser(); } diff --git a/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php b/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php index 466175b..0a7b394 100644 --- a/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php +++ b/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php @@ -330,7 +330,7 @@ public function renderNewCommentsNodeLinks(Request $request) { $links = array(); foreach ($nids as $nid) { $node = node_load($nid); - $new = $this->commentManager->getCountNewComments($node->id(), 'node'); + $new = $this->commentManager->getCountNewComments('node', $node->id()); $query = comment_new_page_count($node->{$field_name}->comment_count, $new, $node); $links[$nid] = array( 'new_comment_count' => (int)$new, diff --git a/core/modules/forum/lib/Drupal/forum/ForumManager.php b/core/modules/forum/lib/Drupal/forum/ForumManager.php index afea040..b4fb55e 100644 --- a/core/modules/forum/lib/Drupal/forum/ForumManager.php +++ b/core/modules/forum/lib/Drupal/forum/ForumManager.php @@ -321,7 +321,7 @@ protected function getTopicOrder($sortby) { * Number of new comments. */ protected function numberNew($nid, $timestamp) { - return $this->commentManager->getCountNewComments($nid, 'node', 'comment_forum', $timestamp); + return $this->commentManager->getCountNewComments('node', $nid, 'comment_forum', $timestamp); } /** diff --git a/core/modules/tracker/tracker.pages.inc b/core/modules/tracker/tracker.pages.inc index dc6c916..500d981 100644 --- a/core/modules/tracker/tracker.pages.inc +++ b/core/modules/tracker/tracker.pages.inc @@ -81,7 +81,7 @@ function tracker_page($account = NULL, $set_title = FALSE) { if ($node->comment_count) { $comments = $node->comment_count; - if ($new = \Drupal::service('comment.manager')->getCountNewComments($node->id(), 'node')) { + if ($new = \Drupal::service('comment.manager')->getCountNewComments('node', $node->id())) { $comments .= '
'; $comments .= l(format_plural($new, '1 new', '@count new'), 'node/' . $node->id(), array('fragment' => 'new')); }