From c7d350b5104e8421606d8dd56ca120c4f5625f4c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 10 Jan 2022 12:19:54 +0100 Subject: [PATCH] Bug 29803: Prevent local cover image to be hidden if Coce is enabled If Coce is enabled by no image are returned by the service, then no other image will be displayed (actually un-hidden) The getURL is returning early if no image is returned by the service and the "done" flag is never set. Test plan: Add a local cover image to a bibliographic record (ktd biblionumber=14 is good) Set CoceHost = http://coce.bywatersolutions.com Select all CoceProviders Enable OpacCoce => If no image is returned by Coce then the local image should be displayed anyway Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens Signed-off-by: Fridolin Somers Signed-off-by: Kyle M Hall --- 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 607cb89921..090059ba92 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/coce.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/coce.js @@ -20,7 +20,7 @@ KOHA.coce = { var id = $(this).attr("class"); // id=isbn if (id !== '') { ids.push(id); } }); - if (ids.length == 0) return; + if (ids.length == 0) { this.done = 1; return; } ids = ids.join(','); var coceURL = host + '/cover?id=' + ids + '&provider=' + provider; $.ajax({ -- 2.39.5