From 9aa21496aef897a589f6b108c8cf7b747d3f26fd Mon Sep 17 00:00:00 2001
From: Nathaniel Catchpole <catch@35733.no-reply.drupal.org>
Date: Tue, 11 Feb 2014 11:27:02 +0000
Subject: [PATCH] Issue #2094335 by andypost: Statistics.php needs a lower
 bootstrap level.

---
 .../lib/Drupal/statistics/Tests/StatisticsLoggingTest.php     | 1 +
 core/modules/statistics/statistics.php                        | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php
index 8443155fdc0f..d3c03e0ec613 100644
--- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php
+++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php
@@ -97,4 +97,5 @@ function testLogging() {
     $node_counter = statistics_get($this->node->id());
     $this->assertIdentical($node_counter['totalcount'], '1');
   }
+
 }
diff --git a/core/modules/statistics/statistics.php b/core/modules/statistics/statistics.php
index 59675f1cefc5..03908f24bbc7 100644
--- a/core/modules/statistics/statistics.php
+++ b/core/modules/statistics/statistics.php
@@ -11,12 +11,12 @@
 // Load the Drupal bootstrap.
 require_once dirname(dirname(__DIR__)) . '/vendor/autoload.php';
 require_once dirname(dirname(__DIR__)) . '/includes/bootstrap.inc';
-drupal_bootstrap(DRUPAL_BOOTSTRAP_PAGE_CACHE);
+drupal_bootstrap(DRUPAL_BOOTSTRAP_KERNEL);
 
 if (\Drupal::config('statistics.settings')->get('count_content_views')) {
   $nid = filter_input(INPUT_POST, 'nid', FILTER_VALIDATE_INT);
   if ($nid) {
-    db_merge('node_counter')
+    \Drupal::database()->merge('node_counter')
       ->key(array('nid' => $nid))
       ->fields(array(
         'daycount' => 1,
-- 
GitLab