Not compatible with D9: symfony/http-kernel

Created on 29 September 2023, about 1 year ago
Updated 12 September 2024, 2 months ago

Problem/Motivation

Declaration of
Drupal\cloudflare\CloudFlareMiddleware::handle(Symfony\Component\HttpFoundation\Request $request, $type = self::MAIN_REQUEST, bool $catch = true): Symfony\Component\HttpFoundation\Response
 must be compatible with Symfony\Component\HttpKernel\HttpKernelInterface::handle(Symfony\Component\HttpFoundation\Request $request, $type = self::MASTER_REQUEST, $catch = true)
in /var/www/html/web/modules/contrib/cloudflare/src/CloudFlareMiddleware.php

Steps to reproduce

Install v2 with Drupal 9.x (I'm using 9.5.11)

D10: Symfony\Component\HttpKernel\HttpKernelInterface::handler
public function handle(Request $request, int $type = self::MAIN_REQUEST, bool $catch = true): Response;

vs

D9: Symfony\Component\HttpKernel\HttpKernelInterface::handler
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true);

We have in v2:
public function handle(Request $request, $type = self::MAIN_REQUEST, bool $catch = TRUE): Response {}

🐛 Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇭🇺Hungary szato

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

Comments & Activities

  • Issue created by @szato
  • 🇺🇸United States mikeegoulding

    I ran into this today as well. I don't think we'll want to make this change permanent or commit this but maybe this will help others until 9.x hits end-of-life soon.

  • 🇷🇴Romania abautu

    I ran into this issue also, while preparing the upgrade from 9.5.11 to 10. Patch from #3 is the correct _temporary_ fix (should be removed after upgrade), but it declares $catch parameter as bool (while in D9.5 core, it is mixed). Therefore, the update will still crash when patch is applied. I created a new one that replaces "bool $catch" with "$catch".

  • 🇷🇴Romania abautu

    In addition from changes in #4, there is also a typo that needs fixing or site will crash with fatal error.

  • Status changed to RTBC about 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    Composer require failure
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    Composer require failure
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    Composer require failure
  • 🇭🇺Hungary szato

    Tested patch #5, works for me.

  • First commit to issue fork.
  • Status changed to Closed: outdated about 1 year ago
  • 🇬🇧United Kingdom scott_euser

    This seems to be fixed in 2.0.x-dev already

  • Status changed to RTBC about 1 year ago
  • 🇭🇺Hungary szato

    @scott_euser,

    I'm using D9 with 2.0.x-dev (last commit hash: 4adb59b882f0c64d661e854e4bb48dc3628c36cd): without the patch, I got the mentioned error and WSOD.

  • 🇮🇳India sadashiv

    Patch #5 works, I think this should be released as 2.0.0-alpha1 breaks in it's current state.

    Thanks,
    Sadashiv.

  • Patch #5 works for Drupal 10

  • Status changed to Needs work 10 months ago
  • 🇵🇹Portugal jcnventura

    Since Drupal 9 is no longer supported, I guess that this is no longer a problem, and the current definition seems fine.

    However, this probably also means that the module should drop support for Drupal 9.

    Making it needs work so that this change is done instead of what is proposed in #5

  • Status changed to Closed: outdated 2 months ago
  • 🇳🇿New Zealand RoSk0 Wellington

    Drupal 10 and 11 are the only supported version now.

Production build 0.71.5 2024