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
Comments
Comment #2
_shyHere is a patch to fix the issue with a function declaration.
Comment #3
_shyComment #4
_shyUpdated the patch, and found a few entity query calls without
accessCheck()function.Comment #5
_shyComment #6
_shyAlso, 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.
Comment #7
akram khanI 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.
Comment #8
netgeek123 commentedIs anyone going to fork this and bring it up to drupal 11? :)
Comment #10
mrweiner commentedUpdating this so that it's against 2.x since that is the forked version for updates.
Comment #13
mrweiner commentedSorry 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.
Comment #14
mrweiner commentedGah, sorry @_shy, missed giving you credit in the commit. Updating to give you credit for this.