Skip to content

Commit 204f619

Browse files
committed
Correct bad non-hash range param for BL 7.x
This branch correction is not necessary in BL 8, not sure why
1 parent 35646d7 commit 204f619

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/presenters/blacklight_range_limit/filter_field.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ def remove(item)
5050
def values(except: [])
5151
params = search_state.params
5252
param_key = filters_key
53-
range = if params.dig(param_key, config.key).is_a? Range
53+
range = if !params.try(:dig, param_key).respond_to?(:dig)
54+
# bad data, not a hash at all, correct it, only necessary in BL
55+
# prior to 8.x, not sure why.
56+
params.delete(param_key)
57+
nil
58+
elsif params.dig(param_key, config.key).is_a? Range
5459
params.dig(param_key, config.key)
5560
elsif params.dig(param_key, config.key).is_a? Hash
5661
b_bound = params.dig(param_key, config.key, :begin).presence

0 commit comments

Comments
 (0)