Bug 36966: Fix local cover image links for items

This change fixes the local cover image links for items by removing
unnecessary parameters, an invalid link, and an uninitialised
Template::Toolkit variable.

Test plan:
0. Apply patch
1. Enable syspref 'LocalCoverImages'
3. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
4. Click on the dropdown next to "Edit" at the item level
5. Upload an image for the item
6. Note that the local cover image appears in the holdings table
7. Click on the image and note that it loads in the light box
8. Success!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
David Cook 2024-05-27 03:33:06 +00:00 committed by Katrin Fischer
parent 909a72c58f
commit 4183b073e6
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 2 additions and 2 deletions

View File

@ -326,8 +326,8 @@
node += '<div class="cover-slider">';
row.cover_image_ids.forEach(id => {
node += '<div class="cover-image local-coverimg">';
node += '<a href="/cgi-bin/koha/catalogue/image.pl?itemnumber=%s&amp;imagenumber=%s" title="%s">'.format(id, id, _("Local cover image"));
node += '<img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=%s" alt="%s" data-link="/cgi-bin/koha/catalogue/imageviewer.pl?itemnumber=[% item.itemnumber | uri %]&amp;imagenumber=%s" />'.format(id, id, _("Local cover image"));
node += '<a href="/cgi-bin/koha/catalogue/image.pl?imagenumber=%s" title="%s">'.format(id, _("Local cover image"));
node += '<img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&imagenumber=%s" alt="%s" />'.format(id, _("Local cover image"));
node += '</a>';
node += '</div>';
});