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

Issue fork httpbl-3368921

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

_shY created an issue. See original summary.

_shy’s picture

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

_shy’s picture

Status: Active » Needs review
_shy’s picture

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

_shy’s picture

_shy’s picture

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.

akram khan’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new210.25 KB
new294.23 KB

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.

netgeek123’s picture

Is anyone going to fork this and bring it up to drupal 11? :)

mrweiner made their first commit to this issue’s fork.

mrweiner’s picture

Version: 8.x-1.x-dev » 2.x-dev

Updating this so that it's against 2.x since that is the forked version for updates.

  • mrweiner committed 71155724 on 2.x
    Issue #3368921 by mrweiner, akram khan: Function declaration...
mrweiner’s picture

Status: Reviewed & tested by the community » Fixed
Related issues: +#3514193: D11 Compatibility

Sorry all -- not sure why I never saw this issue (and the errors never showed up on our D10 install until today). Merged in the patch from #6. Opened up another ticket for D11 compatibility.

mrweiner’s picture

Gah, sorry @_shy, missed giving you credit in the commit. Updating to give you credit for this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.