Problem/Motivation

The website encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to Drupal\counter\EventSubscriber\CounterEventsSubscriber::counterInsert() must be an instance of Symfony\Component\HttpKernel\Event\RequestEvent, instance of Symfony\Component\HttpKernel\Event\GetResponseEvent given in Drupal\counter\EventSubscriber\CounterEventsSubscriber->counterInsert() (line 76 of modules/contrib/counter/src/EventSubscriber/CounterEventsSubscriber.php).
Drupal\counter\EventSubscriber\CounterEventsSubscriber->counterInsert(Object, 'kernel.request', Object)
call_user_func(Array, Object, 'kernel.request', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.request', Object) (Line: 127)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Getting the above error on installing the module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ayush.khare created an issue. See original summary.

ayush.khare’s picture

kartiktandon’s picture

Assigned: Unassigned » kartiktandon
kartiktandon’s picture

Assigned: kartiktandon » Unassigned
goyalsushant’s picture

I am working on it.

goyalsushant’s picture

Assigned: Unassigned » goyalsushant
goyalsushant’s picture

Assigned: goyalsushant » Unassigned
Status: Needs work » Needs review
FileSize
1.18 KB

Please find the attached patch for the issue.
This patch only works for Drupal version 8.8.x and 8.9.x

Kindly note since the Symfony versions are different for Drupal 8 and 9, this issue comes up. The Symfony version used in Drupal 8.x is Symfony 3.x and Drupal 9.x is Symfony 4.4+

ayush.khare’s picture