Problem/Motivation

Exposed filters for list text fields using the links plugin that allow multiples are not working.

Steps to reproduce

  1. Have content type with a list text field. (I used the BEF test content type with the bef_letters field).
  2. Set up a view to display the content type.
  3. Setup an exposed filter for the list text field, with the "allow multiple selections" box checked.
  4. Use BEF and set the filter plugin to links
  5. Go to the view and interact with the filters, you get an error message.

Proposed resolution

?

Remaining tasks

?

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

mdranove created an issue. See original summary.

mdranove’s picture

Issue summary: View changes
mdranove’s picture

Issue summary: View changes

mdranove’s picture

Ok so I've pushed up a fix. There's a test for this that already exists in Option "All" doesn't work for links
, just needs to be modified to have ajax enabled on the view. I think what would be good is to merge that one first, then modify the test in it after it's merged. So I'll just put this into NR for now and then we can edit the test once 3555036 is merged.

mdranove’s picture

Status: Active » Needs review
mdranove’s picture

Issue summary: View changes
mdranove’s picture

Issue summary: View changes
smustgrave’s picture

Status: Needs review » Needs work

should have the test attached to the fix

smustgrave’s picture

Status: Needs work » Postponed (maintainer needs more info)
mdranove’s picture

Status: Postponed (maintainer needs more info) » Needs review
Related issues: -#3555036: Select All/None link appears even when not enabled +#3075674: Option "All" doesn't work for links

It's not fixed by #3542106: Pager links doesn't work when ajax is enabled. I added the test here as requested, but let's just be aware this will cause a merge conflict with 3075674 since they both are going to rely on this test.

mdranove’s picture

Status: Needs review » Needs work
mdranove’s picture

Issue summary: View changes
mdranove’s picture

Status: Needs work » Needs review
Parent issue: » #3528584: Html validation error due to non allowed attributes

Ok so it looks like the changes in https://www.drupal.org/project/better_exposed_filters/issues/3528584 were what caused this issue.

I have it working in the latest MR by reverting those changes, fixing up the ajax js a little bit. Also added a test.

Not sure what the implications are for the issue reported in 3528584.

The "All" button still doesn't work, but this is covered in https://www.drupal.org/project/better_exposed_filters/issues/3075674

I'll put it in NR for now.

smustgrave’s picture

Status: Needs review » Needs work

We shouldn't just revert that issue but work on a new solution, else we are just adding the problem back

smustgrave’s picture

Also I'm not seeing this error. Turned ajax on for one of the bef_test views, turned a filter to use links, everything works

hfernandes’s picture

mdranove’s picture

Title: Links ajax broken » Links ajax broken with "select multiple" in list_text fields
Issue summary: View changes
StatusFileSize
new22.31 KB

There's still an issue, but it's a different one from the one I originally reported. Updated the repro steps.

mdranove’s picture

Issue summary: View changes
mdranove’s picture

Issue summary: View changes
dbroll’s picture

+1 for the MR against the latest version, fixed my ajax links not working and subsequent JS error:

Uncaught TypeError: Cannot read properties of undefined (reading 'length') at HTMLAnchorElement. (bef_links_use_ajax.js?t59uzq:25:70) at HTMLAnchorElement.dispatch (jquery.min.js?v=3.7.1:2:40035) at HTMLAnchorElement. (jquery.min.js?v=3.7.1:2:38006)

- Installing drupal/better_exposed_filters (7.1.0-beta4): Extracting archive
- Applying patches for drupal/better_exposed_filters
patches/better_exposed_filters-3555023-203.patch (Issue #3555023: Links ajax broken)

fraserthompson’s picture

The 'name' and 'multiple' attributes were removed for a good reason (because they're not valid on div elements and therefore fail HTML validation), but it looks like this https://git.drupalcode.org/project/better_exposed_filters/-/commit/6cd50... fixes it by returning them as data attributes which makes this MR unnecessary. Maybe the new issue should be opened as a new issue to avoid confusion.

smustgrave’s picture

Status: Needs work » Postponed (maintainer needs more info)

@mdranoe can you see if #3558648: BEF Links with AJAX and auto-submit doesn't unselect after selecting twice fixes the issue here too? Maybe the tickets can be combined.

mdranove’s picture

I tested with that MR but still get the same error message

smustgrave changed the visibility of the branch 3555023-links-ajax-attempt2 to hidden.

fraserthompson’s picture

@mdranove try again? I think it was just a simple issue with string lengths when using multiple vs non multiple select.

smustgrave’s picture

Doesn't work for me, doesn't filter correctly.

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

Combing the two tickets, which means #3558648: BEF Links with AJAX and auto-submit doesn't unselect after selecting twice cannot land with this being fixed and test cases for both.

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.