diff --git a/core/modules/history/history.module b/core/modules/history/history.module index a0dd96c..8d552ef 100644 --- a/core/modules/history/history.module +++ b/core/modules/history/history.module @@ -187,7 +187,7 @@ function history_attach_timestamp(array $element, array $context) { 'data' => array( 'history' => array( 'lastReadTimestamps' => array( - $context['node_id'] => $history[$context['entity_id']], + $context['entity_id'] => $history[$context['entity_id']], ) ), ), diff --git a/core/modules/history/lib/Drupal/history/Controller/HistoryController.php b/core/modules/history/lib/Drupal/history/Controller/HistoryController.php index 6d51320..2adb4b2 100644 --- a/core/modules/history/lib/Drupal/history/Controller/HistoryController.php +++ b/core/modules/history/lib/Drupal/history/Controller/HistoryController.php @@ -68,7 +68,7 @@ public function getNodeReadTimestamps(Request $request) { if (!isset($nids)) { throw new NotFoundHttpException(); } - return new JsonResponse($this->historyManager->getLastViewed('node', $nids, $account)); + return new JsonResponse($this->historyRepository->getLastViewed('node', $nids, $account)); } /** @@ -90,9 +90,9 @@ public function readNode(Request $request, NodeInterface $node) { } // Update the history table, stating that this user viewed this node. - $this->historyManager->updateLastViewed($node, $account); + $this->historyRepository->updateLastViewed($node, $account); - $history = $this->historyManager->getLastViewed('node', array($node->id()), $account); + $history = $this->historyRepository->getLastViewed('node', array($node->id()), $account); return new JsonResponse($history[$node->id()]); }