Bugzilla – Attachment 164296 Details for
Bug 35558
Do not fetch local image if none exists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35558: Do not retrieve the local image if none exists - OPAC
Bug-35558-Do-not-retrieve-the-local-image-if-none-.patch (text/plain), 2.87 KB, created by
Nick Clemens (kidclamp)
on 2024-04-02 18:35:25 UTC
(
hide
)
Description:
Bug 35558: Do not retrieve the local image if none exists - OPAC
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-04-02 18:35:25 UTC
Size:
2.87 KB
patch
obsolete
>From e9f75354abc4e14b53f4d1122db9ca2e14d2e929 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 14 Mar 2024 15:01:39 +0100 >Subject: [PATCH] Bug 35558: Do not retrieve the local image if none exists - > OPAC > >Test plan: > 1 - Enable system preferences: > LocalCoverImages > OPACLocalCoverImages > 2 - open browser tools network page > 3 - Perform an intranet search > 4 - Note a request for each bib like: > http://localhost:8081/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=35 > 5 - Repeat on opac, same requests > 6 - Apply patches > 7 - Restart all > 8 - Repeat searches, note no fetches > 9 - Add local cover images to several biblios in the results >10 - Repeat searches >11 - Note the fetches are only for those records with images >12 - Confirm images still load correctly > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 2 +- > opac/opac-search.pl | 4 ++++ > 2 files changed, 5 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index 5df882aff73..38b4b97fe10 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -340,7 +340,7 @@ > <div class="coverimages cover-slides itemtype_[% SEARCH_RESULT.itemtype | html %]" data-isbn="[% To.json(SEARCH_RESULT.normalized_isbn) | $raw %]" data-imgtitle="[% img_title | html %]"> > <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]"> > >- [% IF ( OPACLocalCoverImages ) %] >+ [% IF ( OPACLocalCoverImages && SEARCH_RESULT.has_local_cover_image ) %] > <span title="[% img_title | html %]" class="[% SEARCH_RESULT.biblionumber | html %]" id="local-thumbnail[% loop.count | html %]"></span> > [% END %] > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 16b69332ff3..540b693ace0 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -702,6 +702,10 @@ for (my $i=0;$i<@servers;$i++) { > > # BZ17530: 'Intelligent' guess if result can be article requested > $res->{artreqpossible} = ( $art_req_itypes->{ $res->{itemtype} // q{} } || $art_req_itypes->{ '*' } ) ? 1 : q{}; >+ >+ if ( C4::Context->preference('OPACLocalCoverImages') ) { >+ $res->{has_local_cover_image} = $res->{biblio_object}->cover_images->count; >+ } > } > > if ($results_hashref->{$server}->{"hits"}){ >-- >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 35558
:
159785
|
160059
|
163136
|
164295
| 164296