Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run filter values through #facet_display_value so that query facets display correctly #71

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

codeforkjeff
Copy link
Contributor

This PR fixes the following issue: if you have a facet field defined as follows:

    config.add_facet_field 'example_query_facet_field', label: 'Publish Date', :query => {
       :years_5 => { label: 'within 5 Years', fq: "pub_date_isort:[#{Time.zone.now.year - 5 } TO *]" },
       :years_10 => { label: 'within 10 Years', fq: "pub_date_isort:[#{Time.zone.now.year - 10 } TO *]" },
       :years_25 => { label: 'within 25 Years', fq: "pub_date_isort:[#{Time.zone.now.year - 25 } TO *]" }
    }

and you filter on it on the advanced search page, the value displayed in the constraints box is "years_5" instead of "within 5 Years."

This PR runs the values through #facet_display_value just like core Blacklight does.

@codeforkjeff codeforkjeff force-pushed the fix-constraints-field-value-display branch from 6707ac9 to 59eb322 Compare January 11, 2017 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant