blacklight_advanced_search icon indicating copy to clipboard operation
blacklight_advanced_search copied to clipboard

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

Open codeforkjeff opened this issue 8 years ago • 0 comments

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 avatar Jan 03 '17 21:01 codeforkjeff