Bug 26933

Summary: Improve handling of multiple covers on catalog search results in the OPAC
Product: Koha Reporter: David Nind <david>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: Patch doesn't apply --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: a.roussos, andrewfh, dcook, heather_hernandez, kch-tr.lhl-consortium, ssammons
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25846
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28180
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Screenshots - Multiple cover images displayed in the OPAC
Bug 26933: Improve handling of multiple covers on catalog search results in the OPAC
Bug 26933: Improve handling of multiple covers on catalog search results in the OPAC

Description David Nind 2020-11-05 04:30:18 UTC
Created attachment 113028 [details]
Screenshots - Multiple cover images displayed in the OPAC

If multiple cover image sources are enabled for the OPAC, multiple images are displayed in search results and record detail pages.

See the attached examples.

To recreate:

1. Enable Amazon (AmazonCoverImages), Google (GoogleJackets), Open Library (OpenLibraryCovers), and local cover images (LocalCoverImages).
2. Search on the OPAC for perl.
3. Note that on the search results pages and record details pages that multiple images are displayed.

I'm assuming here that it is valid to have multiple cover image sources enabled.
Comment 1 Andrew Fuerste-Henry 2021-10-28 15:58:47 UTC
Bug 25846 establishes a design precedent for this on the staff side.
Comment 2 Owen Leonard 2022-07-11 16:18:15 UTC
Since the OPAC detail page has already been upgraded to handle multiple covers like the staff interface has, I'm re-titling this bug to cover only OPAC search results.
Comment 3 David Cook 2022-08-22 03:15:05 UTC
*** Bug 9991 has been marked as a duplicate of this bug. ***
Comment 4 David Cook 2022-08-22 03:30:19 UTC
*** Bug 7669 has been marked as a duplicate of this bug. ***
Comment 5 Owen Leonard 2024-04-10 17:46:09 UTC Comment hidden (obsolete)
Comment 6 Owen Leonard 2024-04-10 17:51:34 UTC
This patch is incomplete in that custom cover images (the CustomCoverImages system preference) will not display in search results. opac-detail.tt has access to biblio.custom_cover_image_url, but the same information isn't available in search results as far as I can tell.

I could use help exposing that information to the template.

I had originally tried to implement this feature by creating a common include file and common JS file so that both search results and the detail page could share code. I think that should still be a future change.
Comment 7 David Cook 2024-04-11 07:08:28 UTC
(In reply to Owen Leonard from comment #6)
> This patch is incomplete in that custom cover images (the CustomCoverImages
> system preference) will not display in search results. opac-detail.tt has
> access to biblio.custom_cover_image_url, but the same information isn't
> available in search results as far as I can tell.
> 
> I could use help exposing that information to the template.

Prior to the patch, there was this line:

[% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]

I imagine you could bang that into a data attribute or something and then go over it in the Javascript?
Comment 8 Owen Leonard 2024-04-11 10:29:17 UTC
Created attachment 164669 [details] [review]
Bug 26933: Improve handling of multiple covers on catalog search results in the OPAC

This patch implements a book cover slider widget for cover images in
search results, matching the way we show covers on the detail page.

To test, apply the page and rebuild the staff client CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

Enable multiple cover image services. The patch was developed with these
services available:

    - Amazon
    - Local cover images (including multiple local cover images)
    - Coce (serving up Amazon, Google, and OpenLibrary images)
    - OpenLibrary
    - Baker & Taylor
    - Google
    - Custom cover images (the CustomCoverImages preference)

Perform a variet of searches and confirm that cover images are
displaying correctly, whether there be 0, 1, 2, or more covers
available for each.
Comment 9 Owen Leonard 2024-04-11 10:31:14 UTC
(In reply to David Cook from comment #7)

> Prior to the patch, there was this line

Thanks David I totally missed that!
Comment 10 David Nind 2024-04-29 08:56:40 UTC
The patch no longer applies 8-(...

git bz apply 26933

Bug 26933 - Improve handling of multiple covers on catalog search results in the OPAC

164669 - Bug 26933: Improve handling of multiple covers on catalog search results in the OPAC

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 26933: Improve handling of multiple covers on catalog search results in the OPAC
Using index info to reconstruct a base tree...
M	koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss
M	koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
Auto-merging koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss
error: Failed to merge in the changes.
Patch failed at 0001 Bug 26933: Improve handling of multiple covers on catalog search results in the OPAC