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

Created on 7 November 2023, about 1 year ago
Updated 31 May 2024, 6 months ago

Problem/Motivation

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).

Steps to reproduce

See attached screenshot.

Proposed resolution

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 )

🐛 Bug report
Status

Postponed: needs info

Version

11.0 🔥

Component
Views 

Last updated about 3 hours ago

Created by

🇫🇷France dalf

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Issue created by @dalf
  • Status changed to Postponed: needs info about 1 year ago
  • 🇳🇱Netherlands Lendude Amsterdam

    Thanks for reporting this.

    I tried to reproduce this with a clean Umami install of Drupal.
    Steps:
    * Added a View containing content with a page display
    * Added a 'content type' exposed filter with 'Allow multiple selections' and 'Limit list to selected items' enabled
    * Saved the View
    * Went to the page showing the View
    * Filtered on 2 content types
    * Filtering worked, no errors

    Am I missing some steps to make this break? The screenshot appears to use a Search API View and index as it's source. Is this really a Drupal core issue or something that needs Search API to reproduce?

  • 🇮🇳India mobym

    Iam also getting similar issue while migrated my website to Drupal 10, My views have exposed fields with multiple selections allowed. in exposed fields i have taxonomy terms. If I deactivate the ajax option, the view returns nothing and generates an error. The error in the logs is as follows:

    Symfony\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).

    Steps to reproduce
    See attached screenshot.

  • 🇷🇴Romania cslevy

    I had the same issue, i did some digging, and I discovered that the filter key was conflicting with some other functionality.

    In my case: I had a multi-language website, and the Language Negotiation was based on the language query parameter, but my exposed filter also had the "language" filter key. I changed that to "lang", and it's working properly.

Production build 0.71.5 2024