TypeError: Drupal\partial_multi\EventSubscriber\PartialMultiRequestSubscriber::onKernelRequestCheckRedirect

Created on 14 April 2023, over 1 year ago
Updated 25 August 2023, about 1 year ago

Hi, I am attempting an upgrade of a site to D10 but I can't access it once upgraded. I get the error below.

Replacing the GetResponseEvent calls with RequestEvent fixes the issue. Not entirely sure how to create a non local patch but

+++ partial_multi/src/EventSubscriber/PartialMultiRequestSubscriber.php	2023-04-14 11:32:29
@@ -8,7 +8,7 @@
 use Drupal\Core\PathProcessor\InboundPathProcessorInterface;
 use Drupal\Core\Routing\TrustedRedirectResponse;
 use Symfony\Component\HttpKernel\KernelEvents;
-use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\HttpKernel\Event\RequestEvent;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 use Drupal\node\NodeInterface;

@@ -70,10 +70,10 @@
   /**
    * Checks to see if a redirect is needed, and if so, redirects.
    *
-   * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
+   * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
    *   The event to process.
    */
-  public function onKernelRequestCheckRedirect(GetResponseEvent $event) {
+  public function onKernelRequestCheckRedirect(RequestEvent $event) {
     // Clone the request to make sure we don't alter anything on it, and
     // figure out the language and path.
     $request = clone $event->getRequest();

Thanks,

TypeError: Drupal\partial_multi\EventSubscriber\PartialMultiRequestSubscriber::onKernelRequestCheckRedirect(): Argument #1 ($event) must be of type Symfony\Component\HttpKernel\Event\GetResponseEvent, Symfony\Component\HttpKernel\Event\RequestEvent given in Drupal\partial_multi\EventSubscriber\PartialMultiRequestSubscriber->onKernelRequestCheckRedirect() (line 76 of modules/contrib/partial_multi/src/EventSubscriber/PartialMultiRequestSubscriber.php).
call_user_func(Array, Object, 'kernel.request', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.request') (Line: 139)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 686)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom Hitby

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024