Problem/Motivation
The Drupal\Tests\views\Unit\Plugin\argument_default\QueryParameterTest fails for Symfony 5.4 with the following deprecation warning:
2x: Since symfony/http-foundation 5.1: Retrieving a non-string value from "Symfony\Component\HttpFoundation\InputBag::get()" is deprecated, and will throw a "Symfony\Component\HttpFoundation\Exception\BadRequestException" exception in Symfony 6.0, use "Symfony\Component\HttpFoundation\InputBag::all($key)" instead.
2x in QueryParameterTest::testGetArgument from Drupal\Tests\views\Unit\Plugin\argument_default
Proposed resolution
Update the plugin Drupal\views\Plugin\views\argument_default\QueryParameter. When the plugin is fixed you will get the exception BadRequestException. Parameter cannot be a string, they must be of the type array. See: https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/HttpFo...
Remaining tasks
TBD
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
TBD
Comments
Comment #2
daffie commentedThe fix.
Changed the status to critical as this is part of the get Symfony 6 in D10 initiative.
Comment #4
daffie commentedDifferent solution. Just like the previous it passes on 9.4 with Symfony 5.4.
Comment #5
longwaveRTBC. We have to use the
all()[...]technique as Symfony now enforces returning either an array (withall()) or a string (withget()), but our code here handles both cases correctly.Comment #7
catchCommitted/pushed to 9.4.x and cherry-picked to 9.3.x, thanks!