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.
| Comment | File | Size | Author |
|---|
Issue fork trailing_slash-3253681
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
Comment #2
smulvih2Patch fixes the issue using PHP 8.0.12.
Comment #3
michael.acampora commentedThe patch in #2 overwrites the default values of the extended class "UrlGenerator", this could lead to potential issue's. I think it's better to just add a default value to the added parameter "$path_processor_language" to fix the deprecation issue.
This argument is added in the "Drupal\trailing_slash\TrailingSlashServiceProvider" class.
Comment #6
parisekOpened MR with patch from mike.vindicate, working great for me, RTBC
Comment #9
astonvictor commentedMerged the MR.