From c469c0e8aad87e4a1df3ed051ed1e1d2be1910f4 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Mon, 23 Sep 2024 10:53:26 -0500 Subject: [PATCH] Call the constraints component directly Deprecate the catalog/_constraints.html.erb partial --- app/views/catalog/_constraints.html.erb | 1 + app/views/catalog/_search_results.html.erb | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/views/catalog/_constraints.html.erb b/app/views/catalog/_constraints.html.erb index 9fc7490b1e..003c552a54 100644 --- a/app/views/catalog/_constraints.html.erb +++ b/app/views/catalog/_constraints.html.erb @@ -1 +1,2 @@ +<% Blacklight.deprecation.warn('The partial catalog/_constraints.html.erb will be removed in Blacklight 9.0. Call the constraints_component instead') unless hide_warning %> <%= render (blacklight_config&.view_config(document_index_view_type)&.constraints_component || Blacklight::ConstraintsComponent).new(search_state: search_state) %> diff --git a/app/views/catalog/_search_results.html.erb b/app/views/catalog/_search_results.html.erb index 1b77d985e0..8418089974 100644 --- a/app/views/catalog/_search_results.html.erb +++ b/app/views/catalog/_search_results.html.erb @@ -13,8 +13,12 @@ <% content_for(:container_header) do -%> <%= render 'search_results_header' %> - <%= render 'constraints' %> -<% end %> + <% partials = lookup_context.find_all('constraints', lookup_context.prefixes, true, [], {}) %> + <% unless partials.first.identifier.starts_with? Blacklight.root %> + <% Blacklight.deprecation.warn('The partial catalog/_constraints.html.erb will be removed in Blacklight 9.0. Call the constraints_component instead') %> + <% end %> + <%= render 'constraints', hide_warning: true %> +d<% end %> <%= render 'search_header' %>