Exposed filter with multiple selections allowed generates error "Input value contains a non-scalar value"

Created on 7 March 2024, 10 months ago
Updated 11 March 2024, 10 months ago

Setup

  • Solr version:8.11.2
  • Drupal Core version: 10.2.3
  • Search API version: 8.x-1.31
  • Search API Solr version: 4.3.1
  • Configured Solr Connector: Basic Auth

Issue

Since I migrate my website to Drupal 10, I've had views that no longer work properly.
My views have exposed fields with multiple selections allowed. If the ajax option is activated, the view works and displays the filtered results. If I deactivate the ajax option, the view returns nothing and generates an error. The error in the logs is as follows:
ymfony\Component\HttpKernel\Exception\BadRequestHttpException: Input value "type" contains a non-scalar value. in Symfony\Component\HttpKernel\HttpKernel->handle() (line 83 of /app/devs/vendor/symfony/http-kernel/HttpKernel.php).

It seems that Symfony 6 no longer allows you to retrieve a non-scalar value from the InputBag. If you're trying to get an array value from there, you have to use the ->all() method. (solution issued from the following issue https://www.drupal.org/project/simple_media_bulk_upload/issues/3370657 🐛 Symfony\Component\HttpKernel\Exception\BadRequestHttpException: Input value contains a non-scalar value RTBC )

What I'm seeing is that with the ajax option enabled, the view works, but if you want to access the page by adding the parameters to the URL it doesn't work.
Example:
This URL works: https://www.enerdata.net/about-us/references/
If I check Case study and click on the Apply button, the URL is set to https://www.enerdata.net/about-us/references/?type[case_study]=case_study and the display is working (thanks to ajax).
But if I try to access the webpage directly from the following URL: https://www.enerdata.net/about-us/references/?type[case_study]=case_study then it doesn't work.

If you deactivate the ajax option you immediately get the error.

🐛 Bug report
Status

Active

Version

4.3

Component

Code

Created by

🇫🇷France dalf

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

Comments & Activities

Production build 0.71.5 2024