Bugzilla – Attachment 76057 Details for
Bug 20919
A Zebra query is done for each item when opening a record detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20919: Remove unecessary search calls on the biblio detail page
Bug-20919-Remove-unecessary-search-calls-on-the-bi.patch (text/plain), 2.01 KB, created by
Jonathan Druart
on 2018-06-14 14:37:59 UTC
(
hide
)
Description:
Bug 20919: Remove unecessary search calls on the biblio detail page
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-06-14 14:37:59 UTC
Size:
2.01 KB
patch
obsolete
>From 15ef8a1212788c26bda7145002751510c45e8025 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 14 Jun 2018 11:31:02 -0300 >Subject: [PATCH] Bug 20919: Remove unecessary search calls on the biblio > detail page > >There is a countanalytics flag that is set for items used in analytical >biblio records. This flag is only used in the template when 'analyze' >has been passed to the script. >In order to avoid unecessary search calls (1 per item), $analyse must be >tested. > >Test plan: >0. Do not apply the patch >1. tail -f /var/log/koha/kohadev/zebra-output.log >2. Hit a bibliographic record detail page with several items >3. Notice that the log has 1 line per item: > 11:30:36-14/06 zebrasrv(32) [warn] ir_session (exception) >4. Apply the patch >5. Hit the page again >6. There is nothing in the zebra log file > >If you are familiar with analytic records, confirm that you are not >allowed to remove an item that is used in analytical biblio records. >--- > catalogue/detail.pl | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 86a0698c2f..5604299def 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -297,11 +297,15 @@ foreach my $item (@items) { > $item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title}; > } > >- #count if item is used in analytical bibliorecords >- my $countanalytics= GetAnalyticsCount($item->{itemnumber}); >- if ($countanalytics > 0){ >- $analytics_flag=1; >- $item->{countanalytics} = $countanalytics; >+ >+ if ( $analyze ) { >+ # count if item is used in analytical bibliorecords >+ # The 'countanalytics' flag is only used in the templates if analyze is set >+ my $countanalytics= GetAnalyticsCount($item->{itemnumber}); >+ if ($countanalytics > 0){ >+ $analytics_flag=1; >+ $item->{countanalytics} = $countanalytics; >+ } > } > > if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){ >-- >2.11.0
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 20919
:
76057
|
76090
|
76862
|
76881