Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

🐛 Correct thumbnail_path_ss solr index value #2230

Merged
merged 7 commits into from
Jun 3, 2024
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
1 change: 1 addition & 0 deletions app/indexers/collection_resource_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class CollectionResourceIndexer < Hyrax::Indexers::PcdmCollectionIndexer
include Hyrax::Indexer(:basic_metadata)
include Hyrax::Indexer(:bulkrax_metadata)
include Hyrax::Indexer(:collection_resource)
include Hyrax::IndexesThumbnails

def to_solr
super.tap do |index_document|
Expand Down
6 changes: 5 additions & 1 deletion app/services/hyrax/indexes_thumbnails_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ module Hyrax
module IndexesThumbnailsDecorator
# Returns the value for the thumbnail path to put into the solr document
def thumbnail_path
object ||= @object || resource
file_path = CollectionResourceIndexer.thumbnail_path_service.call(object)
if object.try(:collection?) && UploadedCollectionThumbnailPathService.uploaded_thumbnail?(object)
UploadedCollectionThumbnailPathService.call(object)
elsif file_path&.include?('/branding')
file_path.gsub(/.*?(\/branding)/, '\1')
else
super
file_path
end
end
end
Expand Down
Loading