Skip to content

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

Open
codeforkjeff wants to merge 1 commit intoprojectblacklight:mainfrom
codeforkjeff:fix-constraints-field-value-display
Open

run filter values through #facet_display_value so that query facets display correctly#71
codeforkjeff wants to merge 1 commit intoprojectblacklight:mainfrom
codeforkjeff:fix-constraints-field-value-display

Conversation

@codeforkjeff
Copy link
Copy Markdown
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