Skip to content

Commit

Permalink
Deprecate passing no arguments to render_document_index
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Nov 19, 2021
1 parent b3671ec commit e751f00
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion app/helpers/blacklight/render_partials_helper_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/views/bookmarks/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<%= render 'sort_and_per_page' %>
<%= render partial: 'tools', locals: { document_list: @response.documents } %>
<h2 class='section-heading sr-only visually-hidden'><%= t('blacklight.bookmarks.list_title') %></h2>
<%= render_document_index %>
<%= render_document_index @response.documents %>
<%= render 'results_pagination' %>
<% end %>
</div>
2 changes: 1 addition & 1 deletion app/views/catalog/_search_results.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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' %>

0 comments on commit e751f00

Please # to comment.