diff --git a/app/services/hyrax/thumbnail_path_service_decorator.rb b/app/services/hyrax/thumbnail_path_service_decorator.rb index 876c87a7c..d64447aa0 100644 --- a/app/services/hyrax/thumbnail_path_service_decorator.rb +++ b/app/services/hyrax/thumbnail_path_service_decorator.rb @@ -10,10 +10,14 @@ def call(object) collection_thumbnail = CollectionBrandingInfo.where(collection_id: object.id.to_s, role: "thumbnail").first return collection_thumbnail.local_path.gsub(Hyrax.config.branding_path.to_s, '/branding') if collection_thumbnail - return default_image if object.try(:thumbnail_id).blank? + if object.try(:thumbnail_id).blank? + return default_collection_image if object.try(:collection?) + return default_image + end thumb = fetch_thumbnail(object) return default_collection_image unless thumb + return call(thumb) unless thumb.file_set? if audio?(thumb) audio_image diff --git a/config/environments/production.rb b/config/environments/production.rb index 94a15f300..6691a6ac2 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -50,7 +50,7 @@ config.force_ssl = true config.ssl_options = { redirect: { - exclude: -> request { request.path == '/healthz' } + exclude: ->(request) { request.path == '/healthz' } } } # Use the lowest log level to ensure availability of diagnostic information