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

CommentFileSizeAuthor
#4 3248013-4.patch838 bytesdaffie
#2 3248013-2.patch1.41 KBdaffie

Comments

daffie created an issue. See original summary.

daffie’s picture

Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new1.41 KB

The fix.

Changed the status to critical as this is part of the get Symfony 6 in D10 initiative.

Status: Needs review » Needs work

The last submitted patch, 2: 3248013-2.patch, failed testing. View results

daffie’s picture

Status: Needs work » Needs review
StatusFileSize
new838 bytes

Different solution. Just like the previous it passes on 9.4 with Symfony 5.4.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

RTBC. We have to use the all()[...] technique as Symfony now enforces returning either an array (with all()) or a string (with get()), but our code here handles both cases correctly.

  • catch committed 94b94e7 on 9.4.x
    Issue #3248013 by daffie, longwave: [Symfony6] The Drupal\Tests\views\...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.4.x and cherry-picked to 9.3.x, thanks!

  • catch committed 72459cd on 9.3.x
    Issue #3248013 by daffie, longwave: [Symfony6] The Drupal\Tests\views\...

Status: Fixed » Closed (fixed)

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