Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address deprecation warnings coming out of constraints #2294

Merged
merged 2 commits into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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