From 717c6390b311b851307c54ebee99a6959913a4c6 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Fri, 22 Jul 2022 09:50:16 +1200 Subject: [PATCH] Bug 31217: OPAC coce.js is not hiding the coce-coverimg div for single-pixel images This is because OPAC coce.js targets coce-coverimg as a class, when it is actually an ID. Test plan: 1. Set: - 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 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 record in the OPAC. Observe no image is displayed. Sponsored-by: Toi Ohomai Institute of Technology, New Zealand --- koha-tmpl/opac-tmpl/bootstrap/js/coce.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/coce.js b/koha-tmpl/opac-tmpl/bootstrap/js/coce.js index 090059ba92..bfbb0aa945 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/coce.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/coce.js @@ -36,7 +36,7 @@ KOHA.coce = { img.onload = function() { // image dimensions can't be known until image has loaded if (img.height == 1 && img.width == 1) { - $(this).closest(".coce-coverimg").remove(); + $("#coce-coverimg").remove(); } }; $(this).attr('href', url); -- 2.20.1