The submitted value [value] in the [name] element is not allowed.

Created on 8 May 2024, 7 months ago

Problem/Motivation

I have been trying to get up and running with views + facets but it seems like selecting any option from a facet gives me the following error:

The submitted value [value] in the [name] element is not allowed.

Steps to reproduce

  • Download facets 3.0-dev
  • Enable Facets & Facets exposed filters (Experimental)
  • Configure Facet source to be "Views exposed filters"
  • Add facet to the facet source
  • On your view expose the facet via the "Facet" field
  • Configure the field widget via BEF (in my case I am using Select2)
  • View your facet and try to select an option
  • Error is thrown

Proposed resolution

Looking at the issue the problem seems to be that the "options" key is empty at the time the data is sent, I'm not sure why this is, I have tried multiple widgets but they all give different errors.

Remaining tasks

To fix the problem :D

---

Does anyone have a working views + facets + ajax using v 3.0 ?

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom 3li U.K. πŸ‡¬πŸ‡§

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

Comments & Activities

  • Issue created by @3li
  • Same problem here. Using std checkboxes it's working but not with Select2.

  • πŸ‡¬πŸ‡§United Kingdom 3li U.K. πŸ‡¬πŸ‡§
  • πŸ‡¬πŸ‡§United Kingdom 3li U.K. πŸ‡¬πŸ‡§

    Think I found the problem.
    We should be running an extra process facets_exposed_filter_remove_validation (facets/modules/facets_exposed_filters/src/Plugin/views/FacetsViewsPluginTrait.php) which is meant to unset($element["#needs_validation"]);

    However for some reason when using select2 nothing gets created and thus this process does not get attached or run, meaning that validation is still enabled.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Bumping this to major as it affects this basic functionality from working as expected.

  • πŸ‡§πŸ‡ͺBelgium StryKaizer Belgium

    Core Views renders its "exposed form" before it fires the query.

    Because how facets work, we only know the values after the query has been executed.
    Thats why we re-render the exposed form again a second time.

    That's why, if you are debugging, the first time you'll see an empty #options list, which is re-rendered the second time.

    I dont have time to debug the select2 implementation, but this info could help somebody debugging it ;)

  • πŸ‡ͺπŸ‡ΈSpain penyaskito Seville πŸ’ƒ, Spain πŸ‡ͺπŸ‡Έ, UTC+2 πŸ‡ͺπŸ‡Ί

    I have the same issue when using only facets + views + exposing sorting options in the view.
    Not using select2, nor Facets exposed filters (Experimental).
    The results are sorted as expected, just the warning is there.

  • πŸ‡ͺπŸ‡ΈSpain penyaskito Seville πŸ’ƒ, Spain πŸ‡ͺπŸ‡Έ, UTC+2 πŸ‡ͺπŸ‡Ί

    My sort fields were called "name" and "changed".
    Debugging this I found that the valid values were "title", "z_date" and "relevance", but not sure where this keys are coming from.
    Might be a different issue than the one you are having.

Production build 0.71.5 2024