app/controllers/catalog_controller.rb
# if someone requests a facet limit for a facet that doens't exist (but maybe used to),
# current Blacklight (5.6.0) will raise a fatal unexpected error, and/or
# include the facet limit in the Solr request anyway resulting in 0 hits.
# We want to remove the unused facet, and then redirect without it, so an unused
# facet is basically a no-op.
if someone requests a facet limit for a facet that doens't exist (but maybe used to),
current Blacklight (5.6.0) will raise a fatal unexpected error, and/or
include the facet limit in the Solr request anyway resulting in 0 hits.
We want to remove the unused facet, and then redirect without it, so an unused
facet is basically a no-op.
if someone requests a facet limit for a facet that doens ' t exist ( but maybe used to ) current Blacklight ( 5 . 6 . 0 ) will raise a fatal unexpected error and / or include the facet limit in the Solr request anyway resulting in 0 hits . We want to remove the unused facet and then redirect without it so an unused facet is basically a no - op .
def remove_unused_facet_limits
    bad_facets = (params[:f].try(:keys) || []).find_all do |limited_facet|
      ! blacklight_config.facet_fields.keys.include? limited_facet
    end
    if bad_facets.length > 0
      f = params[:f].except(*bad_facets)
      redirect_to url_for(params.merge(:f => f).permit(PERMIT_PARAMS)), :status => :moved_permanently
    end
  end
def remove_unused_facet_limits bad_facets = ( params [ :f ] . try ( :keys ) || [ ] ) . find_all do | limited_facet | ! blacklight_config . facet_fields . keys . include? limited_facet end if bad_facets . length > 0 f = params [ :f ] . except ( * bad_facets ) redirect_to url_for ( params . merge ( :f => f ) . permit ( PERMIT_PARAMS ) ) , :status => :moved_permanently end end
if someone requests a facet limit for a facet that doens't exist (but maybe used to),
current Blacklight (5.6.0) will raise a fatal unexpected error, and/or
include the facet limit in the Solr request anyway resulting in 0 hits.
if someone requests a facet limit for a facet that doens ' t exist ( but maybe used to ) current Blacklight ( 5 . 6 . 0 ) will raise a fatal unexpected error and / or include the facet limit in the Solr request anyway resulting in 0 hits .
# they requested one or more facet limits that aren't configured, redirect # without those.