Skip to content
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
2 changes: 1 addition & 1 deletion app/controllers/concerns/blacklight/bookmarks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module Blacklight::Bookmarks
def action_documents
bookmarks = token_or_current_or_guest_user.bookmarks
bookmark_ids = bookmarks.collect { |b| b.document_id.to_s }
search_service.fetch(bookmark_ids, rows: bookmark_ids.count)
search_service.fetch(bookmark_ids)
end

def action_success_redirect_path
Expand Down
9 changes: 9 additions & 0 deletions app/services/blacklight/search_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,20 @@ def previous_and_next_document_params(*, **)
def fetch_many(ids, extra_controller_params)
extra_controller_params ||= {}

requested_rows = extra_controller_params.delete(:rows)
if requested_rows
Blacklight.deprecation.warn("Passing :rows to fetch_many is deprecated. Create an issue in blacklight if you see this warning. " \
"Otherwise, :rows will be ignored in Blackight 10")
else
requested_rows = ids.count
end

query = search_builder
.with(search_state)
.where(blacklight_config.document_model.unique_key => ids)
.merge(blacklight_config.fetch_many_document_params)
.merge(extra_controller_params)
query.rows(requested_rows)

# find_many was introduced in Blacklight 8.4. Before that, we used the
# regular search method (possibly with a find-many specific `qt` parameter).
Expand Down
Loading