Skip to content
Snippets Groups Projects
Commit 20d517d8 authored by Daniel Pfeiffer's avatar Daniel Pfeiffer Committed by Gisle Hannemyr
Browse files

Issue #2905572 by mediabounds, RumyanaRuseva, saranya ashokkumar: Fixed Error...

Issue #2905572 by mediabounds, RumyanaRuseva, saranya ashokkumar: Fixed Error in updateStatistics on subpages
parent 89c4d691
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ namespace Drupal\statistics_counter\EventSubscriber;
use Drupal;
use Drupal\Core\Database\Database;
use Drupal\Core\Render\HtmlResponse;
use Drupal\node\NodeInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\TerminateEvent;
use Symfony\Component\HttpKernel\KernelEvents;
......@@ -32,7 +33,7 @@ class StatisticsCounterSubscriber implements EventSubscriberInterface {
$node = Drupal::request()->attributes->get('node');
$views = Drupal::config('statistics.settings')->get('count_content_views');
if ($node && ($event->getResponse() instanceof HtmlResponse) && $views) {
if (($node instanceof NodeInterface) && ($event->getResponse() instanceof HtmlResponse) && $views) {
// Support statistics filter.
if (Drupal::moduleHandler()
->moduleExists('statistics_filter') && statistics_filter_do_filter()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment