Problem/Motivation

I added a view which implements multiple entity reference exposed filters and a date range filter. When users pick a date range that doesn't return results the entity reference exposed filters show all the possible options.

In this case I expect no options to be shown.

Comments

fredysan created an issue. See original summary.

fredysan’s picture

StatusFileSize
new681 bytes

I found a way to achieve that inside the SelectiveFilterBase.php file.

chucksimply’s picture

Status: Active » Needs review

Yes! Works great for me. Feel this should be pushed into a release.

Thanks!

chucksimply’s picture

Hmmm... if the exposed filter is totally empty... shouldn't it hide the entire Exposed Filter display?

Request on a similar module for D7 here... https://www.drupal.org/project/views_selective_filters/issues/943724.

Maybe this should be started on a different issue?

chucksimply’s picture

StatusFileSize
new617 bytes

Ran into errors on #2 if there are multiple exposed filters. Also, as mentioned in #4 it only hides the options, not the form.

Here is a new patch that hides the entire form, and handles multiple exposed filters. Only issue I've found... is if "reduce duplicates" is selected on certain exposed filters, the page breaks. Couldn't figure out why. But deselecting "reduce duplicates" fixes it.

ivnish’s picture

Status: Needs review » Reviewed & tested by the community

#5 works, thanks!

  • stomusic committed 668ba6a on 8.x-2.x authored by chucksimply
    Issue #3256177 by chucksimply: Remove all filter options when no results...
stomusic’s picture

Status: Reviewed & tested by the community » Fixed

Tnx for your work, changes were success applied

stomusic’s picture

Status: Fixed » Closed (fixed)