diff --git a/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php b/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php index bebfbed..4999b6b 100644 --- a/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php +++ b/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php @@ -198,7 +198,6 @@ protected function nodeTitleList($counts, $title) { $items = array(); foreach ($counts as $count) { - // $items [] = \Drupal::l($nodes[$count]->getTitle(), $nodes[$count]->urlInfo('canonical')); $items [] = array( '#type' => 'link', '#title' => $nodes[$count]->getTitle(), diff --git a/core/modules/statistics/src/StatisticsDatabaseStorage.php b/core/modules/statistics/src/StatisticsDatabaseStorage.php index b75ad9a..296795e 100644 --- a/core/modules/statistics/src/StatisticsDatabaseStorage.php +++ b/core/modules/statistics/src/StatisticsDatabaseStorage.php @@ -71,13 +71,15 @@ public function fetchViews($nid) { * {@inheritdoc} */ public function fetchAll($order = 'totalcount', $limit = 5) { - if (in_array($order, array('totalcount', 'daycount', 'timestamp'))) { - return $this->connection->select('node_counter', 'nc') - ->fields('nc', array('nid')) - ->orderBy($order, 'DESC')->range(0, $limit) - ->execute()->fetchCol(); + // @todo replace exception with assert() - #2408013. + if (!in_array($order, ['totalcount', 'daycount', 'timestamp'])) { + throw new \InvalidArgumentException(); } - return FALSE; + + return $this->connection->select('node_counter', 'nc') + ->fields('nc', array('nid')) + ->orderBy($order, 'DESC')->range(0, $limit) + ->execute()->fetchCol(); } /** diff --git a/core/modules/statistics/src/StatisticsStorageInterface.php b/core/modules/statistics/src/StatisticsStorageInterface.php index 2de7e38..f666beb 100644 --- a/core/modules/statistics/src/StatisticsStorageInterface.php +++ b/core/modules/statistics/src/StatisticsStorageInterface.php @@ -68,7 +68,9 @@ public function clean($nid); /** * A reset is performed daily. - * Returns if 24 hours has passed since the last reset. + * + * Returns true if it's been more than 24 hours since daily totals have been + * reset. * * @see StatisticsStorageInterface::resetDayCount() To perform the reset. *