summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2013-09-20 13:29:09 (GMT)
committerNathaniel Catchpole2013-09-20 13:29:09 (GMT)
commit4432bb7e1b982a706afe095c128c9f2315ba383a (patch)
treee8c302b3f82edd8e5c5a22c577d015dffaad1c4e
parent2eccba71b6df98391833779f0aa2649be4b50623 (diff)
Issue #2062023 by rhm50, InternetDevels: Replace user_access() calls with $account->hasPermission() in statistics module.
-rw-r--r--core/modules/statistics/lib/Drupal/statistics/Plugin/Block/StatisticsPopularBlock.php2
-rw-r--r--core/modules/statistics/statistics.module2
2 files changed, 2 insertions, 2 deletions
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 1955668..ece4740 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 @@ class StatisticsPopularBlock extends BlockBase {
* 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 34fd8d3..f397285 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');