Bugzilla – Attachment 130867 Details for
Bug 29803
Local cover images don't show in detail page, but only in results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29803: Do not wait for the images more than 5 seconds
Bug-29803-Do-not-wait-for-the-images-more-than-5-s.patch (text/plain), 1.83 KB, created by
Nick Clemens (kidclamp)
on 2022-02-18 15:52:43 UTC
(
hide
)
Description:
Bug 29803: Do not wait for the images more than 5 seconds
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-02-18 15:52:43 UTC
Size:
1.83 KB
patch
obsolete
>From ac1b98d240fd173149eaf291bc46758c6bdd3d31 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 10 Jan 2022 12:29:11 +0100 >Subject: [PATCH] Bug 29803: Do not wait for the images more than 5 seconds > >In case of the previous bug, the page was calling the callback function >every 100ms, endlessly. We should add a test to prevent future similar >problem. > >Test plan: >Remove the previous patch "Prevent local cover image to be hidden if >Coce is enabled" >Recreate the test plan >=> You should see the local image displayed after 5 seconds, and a >log in the JS console > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > >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 70df935b51..f6dc6014a2 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -1561,9 +1561,11 @@ > }); > } /* /verify_images */ > >+ let counter_wait = 0; > function wait_for_images(cb){ > > var loaded = 1; >+ counter_wait++; > > [% IF GoogleJackets %] > if ( loaded ) { >@@ -1583,9 +1585,12 @@ > } > [% END %] > >- if (!loaded) { >+ if (!loaded && counter_wait < 50) {// Do not wait more than 5 seconds > window.setTimeout(function(){wait_for_images(cb);}, 100); > } else { >+ if (counter_wait >= 50 ) { >+ console.log("Could not retrieve the images") >+ } > cb(); > } > } >-- >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 29803
:
129247
|
129248
|
130579
|
130580
|
130866
| 130867