diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php index b269657..b312dec 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php @@ -157,7 +157,7 @@ function setEnvironment(array $info) { // comment_num_new() relies on history_read(), so ensure that no one has // seen the node of this comment. - $this->container->get('history.manager')->deleteByEntity('node', $this->node->id()); + \Drupal::service('history.manager')->deleteByEntity('node', $this->node->id()); } else { $cids = db_query("SELECT cid FROM {comment}")->fetchCol(); diff --git a/core/modules/forum/lib/Drupal/forum/ForumManager.php b/core/modules/forum/lib/Drupal/forum/ForumManager.php index e230a22..51c573b 100644 --- a/core/modules/forum/lib/Drupal/forum/ForumManager.php +++ b/core/modules/forum/lib/Drupal/forum/ForumManager.php @@ -111,7 +111,7 @@ class ForumManager implements ForumManagerInterface { protected $translationManager; /** - * History manager service. + * The history manager service. * * @var \Drupal\history\HistoryManagerInterface */ diff --git a/core/modules/history/lib/Drupal/history/Controller/HistoryController.php b/core/modules/history/lib/Drupal/history/Controller/HistoryController.php index d20178b..fc9e243 100644 --- a/core/modules/history/lib/Drupal/history/Controller/HistoryController.php +++ b/core/modules/history/lib/Drupal/history/Controller/HistoryController.php @@ -86,7 +86,7 @@ public function readNode(Request $request, NodeInterface $node) { $this->historyManager->write('node', $node->id()); $history = $this->historyManager->read('node', array($node->id())); - return new JsonResponse((int) $history[$node->id()]); + return new JsonResponse($history[$node->id()]); } } diff --git a/core/modules/history/lib/Drupal/history/HistoryManager.php b/core/modules/history/lib/Drupal/history/HistoryManager.php index ab8dcdf..84ff5b5 100644 --- a/core/modules/history/lib/Drupal/history/HistoryManager.php +++ b/core/modules/history/lib/Drupal/history/HistoryManager.php @@ -107,7 +107,7 @@ public function purge() { ->condition('timestamp', HISTORY_READ_LIMIT, '<') ->execute(); // Clean static cache. - $this->history = array(); + $this->resetCache(); } /** @@ -118,7 +118,7 @@ public function deleteByUid($uid) { ->condition('uid', $uid) ->execute(); // Clean static cache. - $this->history = array(); + $this->resetCache(); } /** diff --git a/core/modules/history/lib/Drupal/history/HistoryManagerInterface.php b/core/modules/history/lib/Drupal/history/HistoryManagerInterface.php index cdd040d..79e0fb3 100644 --- a/core/modules/history/lib/Drupal/history/HistoryManagerInterface.php +++ b/core/modules/history/lib/Drupal/history/HistoryManagerInterface.php @@ -66,7 +66,7 @@ public function deleteByUid($uid); public function deleteByEntity($entity_type, $entity_id); /** - * Reset the static cache. + * Resets the static cache. */ public function resetCache();