Skip to content

Commit

Permalink
Correct bad non-hash range param for BL 7.x
Browse files Browse the repository at this point in the history
This branch correction is not necessary in BL 8, not sure why
  • Loading branch information
jrochkind committed Dec 2, 2024
1 parent 35646d7 commit 288c657
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/presenters/blacklight_range_limit/filter_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ def remove(item)
def values(except: [])
params = search_state.params
param_key = filters_key
range = if params.dig(param_key, config.key).is_a? Range
range = if !params.try(:dig, param_key).respond_to?(:dig)
# bad data, not a hash at all, correct it. Yes, it's bad form to mutate
# params here, but we found no better solution -- this only necessary in BL
# prior to 8.x, not sure why, but this branch can be omitted in BL 8.
params.delete(param_key)
nil
elsif params.dig(param_key, config.key).is_a? Range
params.dig(param_key, config.key)
elsif params.dig(param_key, config.key).is_a? Hash
b_bound = params.dig(param_key, config.key, :begin).presence
Expand Down

0 comments on commit 288c657

Please sign in to comment.