Skip to content

Commit

Permalink
Merge pull request #2294 from projectblacklight/query_has_constraints
Browse files Browse the repository at this point in the history
Address deprecation warnings coming out of constraints
  • Loading branch information
jcoyne authored Jun 4, 2020
2 parents 3b7c9f5 + 022cfe5 commit 5a84b63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/helpers/blacklight/render_constraints_helper_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def query_has_constraints?(params_or_search_state = search_state)
search_state = convert_to_search_state(params_or_search_state)
search_state.has_constraints?
end
deprecation_deprecate :query_has_constraints?
deprecation_deprecate query_has_constraints?: 'use search_state#has_constraints?'

##
# Render the actual constraints, not including header or footer
Expand Down Expand Up @@ -50,7 +50,7 @@ def render_constraints_query(params_or_search_state = search_state)
return "".html_safe if search_state.query_param.blank?

Deprecation.silence(Blacklight::RenderConstraintsHelperBehavior) do
render_constraint_element(constraint_query_label(search_state),
render_constraint_element(constraint_query_label(search_state.params),
search_state.query_param,
classes: ["query"],
remove: remove_constraint_url(search_state))
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_constraints.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% if query_has_constraints? %>
<% if Deprecation.silence(Blacklight::RenderConstraintsHelperBehavior) { query_has_constraints? } %>
<div id="appliedParams" class="clearfix constraints-container">
<h2 class="sr-only"><%= t('blacklight.search.search_constraints_header') %></h2>

Expand Down

0 comments on commit 5a84b63

Please sign in to comment.