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
Field alias(es) that start with the same string as as another field alias their filter value gets lost when the other field facet is configured to be single value and has an active value.
How to replicate the bug:
- create a facet that has an alias like “fieldname”
- create one with an alias “fieldname1"
- set the facet “fieldname1” to be single value (the main difference between the dropdown and the links)
- filter on a “fieldname” value
- the list got filtered correctly
- additionally filter on a “fieldname1” value
- notice that the “fieldname” filter selected value is not selected any more while it should remain
Proposed resolution
Include the separator in the check instead of just checking whether the filter string starts with the field alias.
I'd leave it out of scope to try and fix conflicts with certain values that contain the separator. Or then at least block this issue on #2899277: Configurable separator.
Remaining tasks
test coverage
User interface changes
none
API changes
none
Data model changes
none
Comment | File | Size | Author |
---|---|---|---|
#2 | filter_active_values-2899295-2.patch | 712 bytes | PieterDC |
|
Comments
Comment #2
PieterDCThanks sardara for helping me debug and fix this piece of code that's in Facet API since 2014 #1393928: Add a per-facet setting that allows only one item to be active at a time
Patch attached. Needs review.
Comment #5
eugene.ilyin CreditAttribution: eugene.ilyin as a volunteer and at DrupalJedi commentedGood catch. Thank you
Comment #6
eugene.ilyin CreditAttribution: eugene.ilyin as a volunteer and at DrupalJedi commented