Problem/Motivation

SelectA11yNG::exposedFormAlter() in select_a11y_ng_bef promotes the element to #type = 'select_a11y_ng' whenever !empty($form[$field_id]). With facets_filter from facets_exposed_filters, valueForm() returns an empty $form['value'] on the first build pass (before the backend query has run); the parent widget then populates #placeholder, which makes !empty() truthy and triggers the promotion. The element ends up with #input = TRUE but #options = [], so Form API rejects any submitted value and aborts the view before the second pass can rebuild it.

Default BEF widget does not reproduce because it never sets #type.

Steps to reproduce

View on a Search API index → exposed facets_filter → BEF widget = Select A11y NG → select any value → "The submitted value X in the … element is not allowed".

Proposed resolution

Guard the promotion on the presence of an existing #type (proof that valueForm() actually built the element):

-    if (!empty($form[$field_id])) {
+    if (!empty($form[$field_id]['#type'])) {
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dpiet created an issue. See original summary.

dpiet’s picture

Status: Active » Needs review
mably’s picture

Status: Needs review » Reviewed & tested by the community

  • dpiet committed 851b10a7 on 1.x
    Issue #3587042 by d.piet: Guard #type promotion in BEF widget against...
dpiet’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.