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:

  1. create a facet that has an alias like “fieldname”
  2. create one with an alias “fieldname1"
  3. set the facet “fieldname1” to be single value (the main difference between the dropdown and the links)
  4. filter on a “fieldname” value
  5. the list got filtered correctly
  6. additionally filter on a “fieldname1” value
  7. 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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

PieterDC created an issue. See original summary.

PieterDC’s picture

Assigned: PieterDC » Unassigned
Status: Active » Needs review
FileSize
712 bytes

Thanks 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.

  • eugene.ilyin committed 58cd88e on 7.x-1.x authored by PieterDC
    Issue #2899295 by PieterDC: Filter active values get lost if field alias...

eugene.ilyin’s picture

Good catch. Thank you

eugene.ilyin’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.