diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 360992b..7c0d2da 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1123,7 +1123,7 @@ function comment_load($cid, $reset = FALSE) { * Entity type 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 $timestamp + * @param int $timestamp * (optional) Time to count from (defaults to time of last user access to * entity). * diff --git a/core/modules/forum/forum.services.yml b/core/modules/forum/forum.services.yml index 7a0f704..e7292d3 100644 --- a/core/modules/forum/forum.services.yml +++ b/core/modules/forum/forum.services.yml @@ -1,8 +1,7 @@ services: forum_manager: class: Drupal\forum\ForumManager - # The history.manager service is optional to allow upgrade path. - arguments: ['@config.factory', '@entity.manager', '@database', '@field.info', '@string_translation', '@?history.manager'] + arguments: ['@config.factory', '@entity.manager', '@database', '@field.info', '@string_translation', '@history.manager'] forum.breadcrumb: class: Drupal\forum\ForumBreadcrumbBuilder arguments: ['@entity.manager', '@config.factory', '@forum_manager'] diff --git a/core/modules/forum/lib/Drupal/forum/ForumManager.php b/core/modules/forum/lib/Drupal/forum/ForumManager.php index 991ec29..418d68f 100644 --- a/core/modules/forum/lib/Drupal/forum/ForumManager.php +++ b/core/modules/forum/lib/Drupal/forum/ForumManager.php @@ -134,7 +134,7 @@ class ForumManager implements ForumManagerInterface { * @param \Drupal\history\HistoryRepositoryInterface $history_manager * The history manager service. */ - public function __construct(ConfigFactory $config_factory, EntityManagerInterface $entity_manager, Connection $connection, FieldInfo $field_info, TranslationInterface $translation_manager, HistoryRepositoryInterface $history_manager = NULL) { + public function __construct(ConfigFactory $config_factory, EntityManagerInterface $entity_manager, Connection $connection, FieldInfo $field_info, TranslationInterface $translation_manager, HistoryRepositoryInterface $history_manager) { $this->configFactory = $config_factory; $this->entityManager = $entity_manager; $this->connection = $connection; @@ -339,16 +339,11 @@ protected function numberNew($nid, $timestamp) { * previously viewed the node; otherwise HISTORY_READ_LIMIT. */ protected function lastVisit($nid) { - $user = \Drupal::currentUser(); - if (isset($this->history[$nid])) { return $this->history[$nid]; } - if (isset($this->historyManager)) { - // History manager service could not be available. - $this->history += $this->historyManager->getLastViewed('node', array($nid)); - } + $this->history += $this->historyManager->getLastViewed('node', array($nid)); if (empty($this->history[$nid])) { $this->history[$nid] = HISTORY_READ_LIMIT; } diff --git a/core/modules/history/history.install b/core/modules/history/history.install index 8714b27..f9ab637 100644 --- a/core/modules/history/history.install +++ b/core/modules/history/history.install @@ -10,7 +10,7 @@ */ function history_schema() { $schema['history'] = array( - 'description' => 'A record of which {users} have read which {entities}s.', + 'description' => 'A record of which {users} have read which entities.', 'fields' => array( 'uid' => array( 'description' => 'The {users}.uid that read the {history}.entity_id entity.',