Function declaration compatibility with Drupal 10

Created on 23 June 2023, over 1 year ago
Updated 10 July 2023, over 1 year ago

Problem/Motivation

After installing the module to the Drupal 10 site got the following errors:

Fatal error: Declaration of Drupal\httpbl\HttpblMiddleware::handle(Symfony\Component\HttpFoundation\Request $request, $type = Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST, $catch = true) must be compatible with Symfony\Component\HttpKernel\HttpKernelInterface::handle(Symfony\Component\HttpFoundation\Request $request, int $type = self::MAIN_REQUEST, bool $catch = true): Symfony\Component\HttpFoundation\Response in /var/www/html/web/modules/composer/httpbl/src/HttpblMiddleware.php on line 56

Fatal error: Declaration of Drupal\httpbl\Logger\HttpblLogTrapper::log($level, $message, array $context = []) must be compatible with Drupal\Core\Logger\RfcLoggerTrait::log($level, Stringable|string $message, array $context = []): void in /var/www/html/web/modules/composer/httpbl/src/Logger/HttpblLogTrapper.php on line 148
🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

🇺🇦Ukraine _shy Ukraine, Lutsk 🇺🇦

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

Comments & Activities

  • Issue created by @_shy
  • 🇺🇦Ukraine _shy Ukraine, Lutsk 🇺🇦

    Here is a patch to fix the issue with a function declaration.

  • Status changed to Needs review over 1 year ago
  • 🇺🇦Ukraine _shy Ukraine, Lutsk 🇺🇦
  • 🇺🇦Ukraine _shy Ukraine, Lutsk 🇺🇦

    Updated the patch, and found a few entity query calls without accessCheck() function.

  • 🇺🇦Ukraine _shy Ukraine, Lutsk 🇺🇦
  • 🇺🇦Ukraine _shy Ukraine, Lutsk 🇺🇦

    Also, found and fixed the following error:

    Fetching deprecated class constant MASTER_REQUEST of class Symfony\Component\HttpKernel\HttpKernelInterface: since symfony/http-kernel 5.3, use MAIN_REQUEST instead. To ease the migration, this constant won't be removed until Symfony 7.0.

    P.S. sorry for spamming patches.

  • Status changed to RTBC over 1 year ago
  • 🇮🇳India Akram Khan Cuttack, Odisha

    I reviewed the patch and it's resolved the issue. Before patch when i try to extend the module it give fatal error and after applying patch the module got enabled successfully. Additionally, I have attached before and after state screenshots for reference.

Production build 0.71.5 2024