-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from scientist-softserv/i765-fix-414-uri-too-l…
…ong-error-on-review-submissions-page Fix 414 URI Too Long error on Review Submissions page
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
# OVERRIDE FILE from Hyrax v3.1.0 - delete after upgrading to Hyrax >= v4.0.0 | ||
|
||
module Hyrax | ||
# This decorator backports a conceptual fix from Hyrax v4.0.0. It | ||
# prevents a `414 Request-URI Too Long` RSolr error from being | ||
# thrown on the "Review Submissions" page (/admin/workflows). | ||
# | ||
# This is a "conceptual" fix because it is not a line-for-line change | ||
# from Hyrax v4.0.0. Rather, it backports the concept that using | ||
# POST instead of GET allows for larger requests to be sent to Solr. | ||
# | ||
# Reference: https://github.com/samvera/hyrax/issues/5926 | ||
module SolrQueryServiceDecorator | ||
## | ||
# @return [Enumerable<SolrDocument>] | ||
def solr_documents | ||
# OVERRIDE: replace #get with solr_service#post | ||
solr_service.post(build)['response']['docs'].map { |doc| self.class.document_model.new(doc) } | ||
end | ||
end | ||
end | ||
|
||
Hyrax::SolrQueryService.prepend(Hyrax::SolrQueryServiceDecorator) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters