Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When you select a facet value, and later that facet value is getting hidden because no results exist for that combination, we need a way to remember that value was initially selected, so it stays selected once it is relevant again.
I added a video to explain the issue, as you see, Red is not remembered.
Comment | File | Size | Author |
---|---|---|---|
#5 | 3400585-5.patch | 2.86 KB | StryKaizer |
#3 | 3400585-3.patch | 2.19 KB | StryKaizer |
Demo-issue-tag-forgot.mp4 | 184.44 KB | StryKaizer |
Comments
Comment #2
StryKaizerThis needs thorough review before going in.
Since we need to "emulate" values which are not in the option list, but we want the same form element name, we add hidden form values as text strings.
Doing this, we need to be sure we do not introduce any security issues before committing...
Comment #3
StryKaizerReplaced the string in favor of an actual hidden form element
Comment #4
malik.kotob CreditAttribution: malik.kotob at Pantheon commentedTested and worked very well!
Comment #5
StryKaizerAdded check to ensure we only alter views_exposed_forms for views which actually use facets exposed filters.
Comment #8
StryKaizer