Bugzilla – Attachment 150620 Details for
Bug 32412
OPACShelfBrowser controls add extra Coce images to biblio-cover-slider
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32412: Do not reload COCE image for biblio
Bug-32412-Do-not-reload-COCE-image-for-biblio.patch (text/plain), 3.67 KB, created by
Lucas Gass (lukeg)
on 2023-05-03 21:37:35 UTC
(
hide
)
Description:
Bug 32412: Do not reload COCE image for biblio
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-05-03 21:37:35 UTC
Size:
3.67 KB
patch
obsolete
>From f352736f0b0b75a3b6cf6229034908271d5ae9a3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 3 May 2023 11:16:14 +0200 >Subject: [PATCH] Bug 32412: Do not reload COCE image for biblio > >We do not want to fetch again the new image for the biblio record. We >only want to fetch those for the shelf browser. > >Note that the third parameter 'covernewwindow' was not used. > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 4 ++-- > koha-tmpl/opac-tmpl/bootstrap/js/coce.js | 8 +++++--- > 2 files changed, 7 insertions(+), 5 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 1bb3debb6d..71aa68f180 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -1880,7 +1880,7 @@ > KOHA.Google.GetCoverFromIsbn([% covernewwindow | html %]); > [% END %] > [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %] >- KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]',[% covernewwindow | html %]); >+ KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]', $("#bibliodescriptions")); > [% END %] > [% IF OpenLibraryCovers %] > KOHA.OpenLibrary.GetCoverFromIsbn(); >@@ -1906,7 +1906,7 @@ > KOHA.Google.GetCoverFromIsbn([% covernewwindow | html %]); > [% END %] > [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %] >- KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]',[% covernewwindow | html %]); >+ KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]', $("#bibliodescriptions")); > [% END %] > [% IF OpenLibraryCovers %] > KOHA.OpenLibrary.GetCoverFromIsbn(); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/coce.js b/koha-tmpl/opac-tmpl/bootstrap/js/coce.js >index 65772380dd..8508d3a82b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/coce.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/coce.js >@@ -14,9 +14,11 @@ KOHA.coce = { > * and run a search with all collected isbns to coce cover service. > * The result is asynchronously returned, and used to append <img>. > */ >- getURL: function(host, provider) { >+ getURL: function(host, provider, parent=null) { > var ids = []; >- $("[id^=coce-thumbnail]").each(function() { >+ const thumbnail_selector = "[id^=coce-thumbnail]"; >+ let thumbnail_nodes = parent ? parent.find(thumbnail_selector) : $(thumbnail_selector); >+ thumbnail_nodes.each(function() { > var id = $(this).attr("class"); // id=isbn > if (id !== '') { ids.push(id); } > }); >@@ -40,7 +42,7 @@ KOHA.coce = { > } > }; > $(this).attr('href', url); >- $(this).empty().append(img); >+ $(this).append(img); > }); > } > }, >-- >2.30.2
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 32412
:
149143
|
149219
|
150567
|
150620
|
150625
|
150626