diff --git a/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php b/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php index 4999b6b..439d97f 100644 --- a/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php +++ b/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php @@ -193,6 +193,18 @@ public function build() { return $content; } + /** + * Generates the render array for the block. + * + * @param array $counts + * An ordered array of node ids. + * + * @param string $title + * The title for the list. + * + * @return array + * A render array for the list. + */ protected function nodeTitleList($counts, $title) { $nodes = $this->entityManager->getStorage('node')->loadMultiple($counts); @@ -214,7 +226,7 @@ protected function nodeTitleList($counts, $title) { '#items' => $items, '#title' => $title, '#cache' => array( - 'context' => 'user.roles', + 'context' => 'user.permissions', 'tags' => $this->entityManager->getDefinition('node')->getListCacheTags(), ), ); diff --git a/core/modules/statistics/src/StatisticsStorageInterface.php b/core/modules/statistics/src/StatisticsStorageInterface.php index 4f66f0c..ab65dae 100644 --- a/core/modules/statistics/src/StatisticsStorageInterface.php +++ b/core/modules/statistics/src/StatisticsStorageInterface.php @@ -50,6 +50,9 @@ public function fetchViews($nid); * - 'daycount' The number of views today. * - 'timestamp' The unix timestamp of the last view. * + * @param int $limit + * The number of node ids to return. + * * @return array * An ordered array of node ids. */