Entity reference filter not working with custom dependent exposed filter identifier

Created on 25 May 2022, about 2 years ago
Updated 23 August 2023, 10 months ago

Problem/Motivation

The dependent entity reference filter stops working when changing the filter identifier of the dependency, with ajax enabled.

For example:
In a view with the filter exposed "A" and "B". Filter "A" is a normal exposed filter and "B" is an entity reference filter. In this scenario, the filter "B" has "Arguments for the view" as the identifier of the filter "A".
While the filter "A" has its default identifier (string equal to its machine name) this combination works perfectly, but when customizing the identifier it stops working.

Steps to reproduce

  1. Create a content block in a view.
  2. Enable ajax
  3. Introduce a filter exposed in a dropdown, for example, referring to a taxonomy term and change the identifier string.
  4. Introduce a type filter (entityreference filter) and configure it. Including putting the filter add previously as "Arguments for the view".
  5. Run the view with the first filter change.
  6. Note that the entity reference filter is not reacting to the first filter update

Proposed resolution

From what I could see the ajax controller code doesn't handle the case when the identifier is different from the filter's machine name.
My suggestion is to identify, find the machine name of it and put it in a new variable, then change this in the necessary zones.

Remaining tasks

Validate the proposed resolution.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡΅πŸ‡ΉPortugal lolgm

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.

Production build 0.69.0 2024