diff --git a/core/modules/statistics/lib/Drupal/statistics/Plugin/Block/StatisticsPopularBlock.php b/core/modules/statistics/lib/Drupal/statistics/Plugin/Block/StatisticsPopularBlock.php index 640ece1..0629ff1 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Plugin/Block/StatisticsPopularBlock.php +++ b/core/modules/statistics/lib/Drupal/statistics/Plugin/Block/StatisticsPopularBlock.php @@ -57,7 +57,7 @@ public function settings() { * Overrides \Drupal\block\BlockBase::access(). */ public function access() { - if (user_access('access content')) { + if (\Drupal::currentUser()->hasPermission('access content')) { $daytop = $this->configuration['top_day_num']; if (!$daytop || !($result = statistics_title_list('daycount', $daytop)) || !($this->day_list = node_title_list($result, t("Today's:")))) { return FALSE; diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module index 853d139..4aa4ec1 100644 --- a/core/modules/statistics/statistics.module +++ b/core/modules/statistics/statistics.module @@ -58,7 +58,7 @@ function statistics_node_view(EntityInterface $node, EntityDisplay $display, $vi } if ($view_mode != 'rss') { - if (user_access('view post access counter')) { + if (Drupal::currentUser()->hasPermission('view post access counter')) { $statistics = statistics_get($node->id()); if ($statistics) { $links['statistics_counter']['title'] = format_plural($statistics['totalcount'], '1 view', '@count views');