Bugzilla – Attachment 139344 Details for
Bug 31217
Fix Coce JavaScript to hide single-pixel cover images in the OPAC lightbox gallery
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31217: OPAC coce.js is not hiding the coce-coverimg div for single-pixel images
Bug-31217-OPAC-cocejs-is-not-hiding-the-coce-cover.patch (text/plain), 3.16 KB, created by
Fridolin Somers
on 2022-08-18 08:16:55 UTC
(
hide
)
Description:
Bug 31217: OPAC coce.js is not hiding the coce-coverimg div for single-pixel images
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2022-08-18 08:16:55 UTC
Size:
3.16 KB
patch
obsolete
>From 90bc6a730c12af2bbb080c59272845c3c34976f6 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Tue, 26 Jul 2022 16:38:29 +1200 >Subject: [PATCH] Bug 31217: OPAC coce.js is not hiding the coce-coverimg div > for single-pixel images > >This is because opac-detail.tt has coce-coverimg as an ID, but OPAC >coce.js targets coce-coverimg as a class. > >opac-detail.tt should be changed to have coce-coverimg as a class. > >Test plan: >1. Set your system preferences: >- CoceHost = https://coce.mykoha.co.nz >- CoceProviders = Select all >- OpacCoce = Enable > >2. Add the ISBN of '9780262336499' to a biblio > >3. Open a "Incognito" window in your browser (recommended to use Google >Chrome to test this) > >4. View the biblio detail page in the OPAC. Observe a 'Coce image from >Amazon' box loads with a spinner > >5. Apply patch and restart services > >6. Clear your browser cache > >7. Reload the same biblio detail page in the OPAC. Observe no image is >displayed. > >8. View another OPAC biblio detail page that does have a successfully >loading coce image and confirm the source of that image is listed: For >example 'Coce image from Amazon.com' is displayed > >Sponsored-by: Toi Ohomai Institute of Technology, New Zealand >Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 9eea246bad..802a642d7c 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -102,7 +102,7 @@ > > [% IF ( Koha.Preference('OPACCoce') && Koha.Preference('CoceProviders') && normalized_isbn ) %] > [% coce_id = normalized_ean || normalized_isbn %] >- <div class="cover-image" id="coce-coverimg"> >+ <div class="cover-image coce-coverimg"> > [% IF ( coce_id ) %] > <a title="Image from Coce" class="[% coce_id | html %]" id="coce-thumbnail-preview"></a> > [% END %] >@@ -1532,7 +1532,7 @@ > lightbox_descriptions.push(_("Image from Google Books (<a href='%s'>see the original image</a>)").format($(img).data('link'))); > } else if( div.attr("id") == "openlibrary-coverimg" ){ > lightbox_descriptions.push(_("Image from OpenLibrary (<a href='%s'>see the original image</a>)").format($(img).data('link'))); >- } else if( div.attr("id") == "coce-coverimg" ){ >+ } else if( div.hasClass("coce-coverimg" ) ){ > // Identify which service's image is being loaded by Coce > var coce_description; > if( $(img).attr("src").indexOf('amazon.com') >= 0 ){ >-- >2.35.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31217
:
137995
|
138070
|
138111
|
138192
|
138198
|
139218
| 139344