From e751f0088500a2dd7f8c26905603238ef6ad9c05 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Thu, 18 Nov 2021 07:47:56 -0600 Subject: [PATCH] Deprecate passing no arguments to render_document_index --- app/helpers/blacklight/render_partials_helper_behavior.rb | 5 ++++- app/views/bookmarks/index.html.erb | 2 +- app/views/catalog/_search_results.html.erb | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/helpers/blacklight/render_partials_helper_behavior.rb b/app/helpers/blacklight/render_partials_helper_behavior.rb index ff6cc66203..95bef8e8b7 100644 --- a/app/helpers/blacklight/render_partials_helper_behavior.rb +++ b/app/helpers/blacklight/render_partials_helper_behavior.rb @@ -9,7 +9,10 @@ module Blacklight::RenderPartialsHelperBehavior # @param [Hash] locals to pass to the render call # @return [String] def render_document_index documents = nil, locals = {} - documents ||= @response.documents + unless documents + Deprecation.warn(self, "Calling render_document_index without documents is deprecated and will be removed in version 8") + documents = @response.documents + end render_document_index_with_view(document_index_view_type, documents, locals) end diff --git a/app/views/bookmarks/index.html.erb b/app/views/bookmarks/index.html.erb index f80a055242..48ce0ba148 100644 --- a/app/views/bookmarks/index.html.erb +++ b/app/views/bookmarks/index.html.erb @@ -14,7 +14,7 @@ <%= render 'sort_and_per_page' %> <%= render partial: 'tools', locals: { document_list: @response.documents } %>

<%= t('blacklight.bookmarks.list_title') %>

- <%= render_document_index %> + <%= render_document_index @response.documents %> <%= render 'results_pagination' %> <% end %> diff --git a/app/views/catalog/_search_results.html.erb b/app/views/catalog/_search_results.html.erb index 4d98a428e0..e871ee7260 100644 --- a/app/views/catalog/_search_results.html.erb +++ b/app/views/catalog/_search_results.html.erb @@ -26,7 +26,7 @@ <%- elsif render_grouped_response? %> <%= Deprecation.silence(Blacklight::RenderPartialsHelperBehavior) { render_grouped_document_index } %> <%- else %> - <%= render_document_index %> + <%= render_document_index @response.documents %> <%- end %> <%= render 'results_pagination' %>