diff --git a/core/modules/search/src/Tests/SearchRankingTest.php b/core/modules/search/src/Tests/SearchRankingTest.php index 7293a06f8c..cf9185136d 100644 --- a/core/modules/search/src/Tests/SearchRankingTest.php +++ b/core/modules/search/src/Tests/SearchRankingTest.php @@ -100,6 +100,7 @@ public function testRankings() { // Simulating content views is kind of difficult in the test. Leave that // to the Statistics module. So instead go ahead and manually update the // counter for this node. + \Drupal::service('statistics.storage')->createTable(\Drupal::entityTypeManager()->getDefinition('node')); $nid = $nodes['views'][1]->id(); db_insert('node_counter') ->fields(['totalcount' => 5, 'daycount' => 5, 'timestamp' => REQUEST_TIME, 'nid' => $nid]) diff --git a/core/modules/statistics/src/StatisticsDatabaseStorage.php b/core/modules/statistics/src/StatisticsDatabaseStorage.php index 7aa57460a2..883556cfdc 100644 --- a/core/modules/statistics/src/StatisticsDatabaseStorage.php +++ b/core/modules/statistics/src/StatisticsDatabaseStorage.php @@ -107,6 +107,7 @@ public function fetchAll(EntityTypeInterface $entity_type, $order = 'totalcount' catch (\Exception $e) { $this->catchException($entity_type, $e); } + return []; } /** @@ -122,6 +123,7 @@ public function deleteViews(EntityTypeInterface $entity_type, $id) { catch (\Exception $e) { $this->catchException($entity_type, $e); } + return FALSE; } /**