Drupal 10 issue: Input value filter contains a non-scalar value.

Created on 5 January 2024, about 1 year ago
Updated 20 February 2024, 12 months ago

I recently updated a project from Drupal 9 to Drupal 10.
I used patch from #3297463 📌 Automated Drupal 10 compatibility fixes Closed: won't fix and mglaman/composer-drupal-lenient to make jsonapi_entity_filter_override D10 compatible.

After the D10 update, an API call like:
https://mywebsite.com/api/pages?filter[changed][value]=01-01-2022&filter...
Results in:
Input value \"filter\" contains a non-scalar value.

After reading this:
https://www.drupal.org/project/jsonapi_extras/issues/3331874 🐛 $request->get may no longer return array as of Symfony 6.0 Fixed
I tested and I changed line 33 from jsonapi_entity_filter_override/src/Controller/JsonApiFilterOverrideEntityResource.php:
$request->query->get('filter'),
to:
$request->query->all()['filter'] ?? []

And now my API call works again.
I'll test some more and create a patch

🐛 Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

🇧🇪Belgium flyke

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

Comments & Activities

Production build 0.71.5 2024