Bug 41078

Summary: Improve handling of multiple covers on shelves/lists results in the OPAC
Product: Koha Reporter: David Cook <dcook>
Component: OPACAssignee: David Cook <dcook>
Status: Needs documenting --- QA Contact: Paul Derscheid <paul.derscheid>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, lauren_denny, lucas
Version: MainKeywords: release-notes-needed
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28180
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00,25.05.06
Circulation function:
Bug Depends on: 26933    
Bug Blocks:    
Attachments: Bug 41078: Add lightbox to OPAC Lists for cover images
Bug 41078: Add lightbox to OPAC Lists for cover images
Bug 41078: Add lightbox to OPAC Lists for cover images
Bug 41078: (follow-up) Use __() instead of _()
Bug 41078: Add lightbox to OPAC Lists for cover images
Bug 41078: (follow-up) Use __() instead of _()

Description David Cook 2025-10-23 04:56:34 UTC
The lightbox gallery is used in the OPAC on the detail page and the search results page, but not the shelves/lists results page.

In the list results, it still has the old clunky display for multiple covers.
Comment 1 David Cook 2025-11-05 00:17:58 UTC
I'm actually going to change this to a bug from enhancement, because of the inconsistency between the detail page, search results, and list results. It looks like the list results are broken really.
Comment 2 David Cook 2025-11-06 05:21:50 UTC
By essentially copying the method from bug 26933 and refactoring a bit of Javascript from there, I think that I have it working in Lists now too

There is a little bit of duplication which could probably be optimised, but I think it's good enough for now.
Comment 3 David Cook 2025-11-06 05:24:50 UTC
Created attachment 189142 [details] [review]
Bug 41078: Add lightbox to OPAC Lists for cover images

This change adds the lightbox from OPAC search results to OPAC lists
for cover images.

Test plan:
0. Enable the following system preferences:
- OPACAmazonCoverImages
- GoogleJackets
- OpenLibraryCovers
1. Using KTD, go to /cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
2. Note that the lightbox for cover images which displays one cover
at a time
3. Create a public list based off those search results
4. Go to that list and note that the 3 cover images just display all
at the same time, which does not look good

5. Apply the patch

6. Refresh the page for the public list results
7. Note that the lightbox is now used like in OPAC search results
Comment 4 Owen Leonard 2025-11-06 12:19:12 UTC
I'm seeing cover images on opac-detail.pl but not in search results or lists. The search results and list contents pages show this js error:

Uncaught ReferenceError: verify_cover_images is not defined
Comment 5 David Cook 2025-11-06 22:17:50 UTC
(In reply to Owen Leonard from comment #4)
> I'm seeing cover images on opac-detail.pl but not in search results or
> lists. The search results and list contents pages show this js error:
> 
> Uncaught ReferenceError: verify_cover_images is not defined

Thanks for that. Looks like I have the fail locally but forgot to "git add" it. Oops! I'll get that fixed up pronto.
Comment 6 David Cook 2025-11-06 22:18:20 UTC
(In reply to David Cook from comment #5)
> Thanks for that. Looks like I have the fail locally but forgot to "git add"
> it. Oops! I'll get that fixed up pronto.

"file" not "fail". I moved "function verify_cover_images" into a JS file so it could be shared between the two templates.
Comment 7 David Cook 2025-11-06 22:40:56 UTC
Created attachment 189246 [details] [review]
Bug 41078: Add lightbox to OPAC Lists for cover images

This change adds the lightbox from OPAC search results to OPAC lists
for cover images.

Test plan:
0. Enable the following system preferences:
- OPACAmazonCoverImages
- GoogleJackets
- OpenLibraryCovers
1. Using KTD, go to /cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
2. Note that the lightbox for cover images which displays one cover
at a time
3. Create a public list based off those search results
4. Go to that list and note that the 3 cover images just display all
at the same time, which does not look good

5. Apply the patch

6. Refresh the page for the public list results
7. Note that the lightbox is now used like in OPAC search results
Comment 8 Owen Leonard 2025-11-07 13:45:02 UTC
Created attachment 189319 [details] [review]
Bug 41078: Add lightbox to OPAC Lists for cover images

This change adds the lightbox from OPAC search results to OPAC lists
for cover images.

Test plan:
0. Enable the following system preferences:
- OPACAmazonCoverImages
- GoogleJackets
- OpenLibraryCovers
1. Using KTD, go to /cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
2. Note that the lightbox for cover images which displays one cover
at a time
3. Create a public list based off those search results
4. Go to that list and note that the 3 cover images just display all
at the same time, which does not look good

5. Apply the patch

6. Refresh the page for the public list results
7. Note that the lightbox is now used like in OPAC search results

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 9 Owen Leonard 2025-11-07 13:45:05 UTC
Created attachment 189320 [details] [review]
Bug 41078: (follow-up) Use __() instead of _()

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 10 David Cook 2025-11-10 22:33:00 UTC
Thanks, Owen. You're a legend.
Comment 11 Paul Derscheid 2025-11-11 07:00:58 UTC
Created attachment 189474 [details] [review]
Bug 41078: Add lightbox to OPAC Lists for cover images

This change adds the lightbox from OPAC search results to OPAC lists
for cover images.

Test plan:
0. Enable the following system preferences:
- OPACAmazonCoverImages
- GoogleJackets
- OpenLibraryCovers
1. Using KTD, go to /cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
2. Note that the lightbox for cover images which displays one cover
at a time
3. Create a public list based off those search results
4. Go to that list and note that the 3 cover images just display all
at the same time, which does not look good

5. Apply the patch

6. Refresh the page for the public list results
7. Note that the lightbox is now used like in OPAC search results

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 12 Paul Derscheid 2025-11-11 07:01:00 UTC
Created attachment 189475 [details] [review]
Bug 41078: (follow-up) Use __() instead of _()

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 13 Lucas Gass (lukeg) 2025-11-17 22:06:23 UTC
please add release notes
Comment 14 Lucas Gass (lukeg) 2025-11-17 22:17:00 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 15 Paul Derscheid 2025-11-25 16:31:17 UTC
Nice work everyone!

Pushed to 25.05.x
Comment 16 Fridolin Somers 2025-12-02 10:55:50 UTC
Not applied to 24.11.x for UI stability in LTS