Core and composer updates

This commit is contained in:
Rob Davies 2017-07-03 16:47:07 +01:00
parent a82634bb98
commit 62cac30480
1118 changed files with 21770 additions and 6306 deletions

View file

@ -10,6 +10,7 @@ use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
use Drupal\node\NodeInterface;
use Drupal\statistics\StatisticsViewsResult;
/**
* Implements hook_help().
@ -125,6 +126,12 @@ function statistics_get($id) {
if ($id > 0) {
/** @var \Drupal\statistics\StatisticsViewsResult $statistics */
$statistics = \Drupal::service('statistics.storage.node')->fetchView($id);
// For backwards compatibility, return FALSE if an invalid node ID was
// passed in.
if (!($statistics instanceof StatisticsViewsResult)) {
return FALSE;
}
return [
'totalcount' => $statistics->getTotalCount(),
'daycount' => $statistics->getDayCount(),