hyku icon indicating copy to clipboard operation
hyku copied to clipboard

Issues with thumbnails on public catalog search results list

Open laritakr opened this issue 2 years ago • 0 comments

Descriptive summary

Public catalog search results page does not show appropriate thumbnails for collections. Collection thumbnail method references only default thumbnails.

The following code works in an individual tenant but has not been tested in a shared tenant's search results.

    # Used by public index views (standard & gallery)
    def collection_thumbnail(document, _image_options = {}, _url_options = {})
      return image_tag(document.thumbnail_path) unless document.thumbnail_id
      return super if Site.instance.default_collection_image.blank?

      image_tag(Site.instance.default_collection_image&.url)
    end

Rationale

Overriding some partials and behavior to generate urls for shared search resulted in a few incorrect behaviors which need to be fixed for collections.

Expected behavior

Public view of catalog search results should show all object thumbnails when they exist, and site-defined defaults when they do not.

Actual behavior

Collections show only Site (if available) or Hyrax (fallback) default thumbnail. It ignores the collection's assigned thumbnail.

Steps to reproduce the behavior

  1. Create a collection with an uploaded thumbnail.
  2. Uploaded thumbnail does not show on public catalog search results views.

Testing notes

  1. Verify that everything works on individual tenants as well as a shared search tenant.
  2. Verify that index, gallery, masonry, and slideshow views all work.
  3. Verify that Site-specific default thumbnail works if one is assigned.

laritakr avatar Jan 17 '23 01:01 laritakr