Bugzilla – Attachment 164295 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
Bug-35558-Do-not-retrieve-the-local-image-if-none-.patch (text/plain), 2.98 KB, created by
Nick Clemens (kidclamp)
on 2024-04-02 18:35:22 UTC
(
hide
)
Description:
Bug 35558: Do not retrieve the local image if none exists
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-04-02 18:35:22 UTC
Size:
2.98 KB
patch
obsolete
>From c8a52125dcf7baaef39deb011ab15ebf9d957ec3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 13 Dec 2023 11:10:24 +0100 >Subject: [PATCH] Bug 35558: Do not retrieve the local image if none exists > >On the search results we are fetching the thumbnails of the local cover >images using catalogue/image.pl >Which means 1 GET per results on the page. > >This patch suggests to have this information beforehand in order to >reduce the number of hits and network traffic? > >However the page load will be slightly slower ofc. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > catalogue/search.pl | 4 ++++ > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt | 2 +- > 2 files changed, 5 insertions(+), 1 deletion(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 62283897179..045a5ed1822 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -665,6 +665,10 @@ for (my $i=0;$i<@servers;$i++) { > if ( grep {$_ eq $line->{'biblionumber'}} @cart_list) { > $line->{'incart'} = 1; > } >+ >+ if ( C4::Context->preference('LocalCoverImages') ) { >+ $line->{has_local_cover_image} = $line->{biblio_object}->cover_images->count; >+ } > } > my( $page_numbers, $hits_to_paginate, $pages, $current_page_number, $previous_page_offset, $next_page_offset, $last_page_offset ) = > Koha::SearchEngine::Search->pagination_bar( >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index e09aeeb0729..91db336895a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -480,7 +480,7 @@ > [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] > <td class="bookcoverimg"> > <div id="cover-slides-[% SEARCH_RESULT.biblionumber | html %]" class="cover-slides" data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]" data-isbn="[% To.json(SEARCH_RESULT.normalized_isbn) | $raw %]" data-processedbiblio="[% PROCESS biblio_a_href biblionumber => SEARCH_RESULT.biblionumber | $raw %]"> >- [% IF ( LocalCoverImages ) %] >+ [% IF ( LocalCoverImages && SEARCH_RESULT.has_local_cover_image ) %] > <div id="local-coverimg-[% SEARCH_RESULT.biblionumber | html %]" class="cover-image local-coverimg"> > <a href="[% PROCESS biblio_a_href biblionumber => SEARCH_RESULT.biblionumber %]"> > <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=[% SEARCH_RESULT.biblionumber | uri %]" alt="Local cover image" /> >-- >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