TrailingSlashUrlGenerator deprecated issue with PHP 8

Created on 10 December 2021, over 2 years ago
Updated 11 March 2024, 4 months ago

Problem/Motivation

I updated my Docker container to PHP 8 and started getting the error below:

Deprecated: Required parameter $path_processor_language follows optional parameter $filter_protocols in /var/www/html/modules/contrib/trailing_slash/src/Routing/TrailingSlashUrlGenerator.php on line 35
The website encountered an unexpected error. Please try again later.
RuntimeException: Failed to start the session because headers have already been sent by "/var/www/html/modules/contrib/trailing_slash/src/Routing/TrailingSlashUrlGenerator.php" at line 35. in Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (line 152 of /var/www/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php).

Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (Line: 164)
Drupal\Core\Session\SessionManager->startNow() (Line: 118)
Drupal\Core\Session\SessionManager->start() (Line: 57)
Symfony\Component\HttpFoundation\Session\Session->start() (Line: 240)
Drupal\big_pipe\Render\BigPipe->performPreSendTasks() (Line: 295)
Drupal\big_pipe\Render\BigPipe->sendContent(Object) (Line: 112)
Drupal\big_pipe\Render\BigPipeResponse->sendContent() (Line: 381)
Symfony\Component\HttpFoundation\Response->send() (Line: 20)

This can be fixed by removing the default values from $filter_protocols. There can't be default values on parameters that precede a parameter without a default value.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada smulvih2 Canada 🍁

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024