Skip to content
New issue

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

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

Already on GitHub? # to your account

Deprecate passing no arguments to render_document_index #2530

Merged
merged 1 commit into from
Nov 19, 2021
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
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' %>