Expected a scalar value as a 2nd argument to "Symfony\Component\HttpFoundation\InputBag::get()", "array" given.

Created on 14 March 2024, 8 months ago
Updated 16 April 2024, 7 months ago

While upgrading a site to Drupal 10, we encountered a situation where views no longer rendered.

The following exception was reported in database log.

InvalidArgumentException: Expected a scalar value as a 2nd argument to "Symfony\Component\HttpFoundation\InputBag::get()", "array" given. in Symfony\Component\HttpFoundation\InputBag->get() (line 31 of /var/www/vendor/symfony/http-foundation/InputBag.php).

This is due to a change in Symfony 6 to no longer accept an array as the default value argument for this method call.

Patch attached which resolves the situation for me.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom grahamC Oxford, UK

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

Comments & Activities

  • Issue created by @grahamC
  • Status changed to RTBC 8 months ago
  • 🇬🇧United Kingdom joachim

    Confirming the problem on D10 - I get this as soon as I've changed a facet source's URL processor to "Granular date Query string.

    The patch fixes the problem.

  • Status changed to Needs review 7 months ago
  • 🇬🇧United Kingdom grahamC Oxford, UK

    Previous patch allowed the views to render again, but breaks as soon as you try to apply a facet...

    New patch attached, based on changes for same problem fixed in main Facets project.

Production build 0.71.5 2024