Bugzilla – Attachment 153183 Details for
Bug 33497
Reduce DB calls on staff detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33497: Don't get host items if the MARC record is invalid
Bug-33497-Dont-get-host-items-if-the-MARC-record-i.patch (text/plain), 2.01 KB, created by
Jonathan Druart
on 2023-07-07 13:52:41 UTC
(
hide
)
Description:
Bug 33497: Don't get host items if the MARC record is invalid
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-07-07 13:52:41 UTC
Size:
2.01 KB
patch
obsolete
>From 6ee70de1048573e96300a143b279322203b71e26 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 7 Jul 2023 15:50:52 +0200 >Subject: [PATCH] Bug 33497: Don't get host items if the MARC record is invalid > >When don't want to explode with "invalid data" later so we need to >condition the host_item search > >call trace was > Koha::Biblio::Metadata::record('Koha::Biblio::Metadata=HASH(0x55ab92e60120)') called at /kohadevbox/koha/Koha/Biblio.pm line 538 > Koha::Biblio::_host_itemnumbers('Koha::Biblio=HASH(0x55ab92e4d5c0)') called at /kohadevbox/koha/Koha/Biblio.pm line 498 > Koha::Biblio::items('Koha::Biblio=HASH(0x55ab92e4d5c0)', 'HASH(0x55ab934615d8)') called at /kohadevbox/koha/catalogue/detail.pl line 200 > >This is fixing t/db_dependent/selenium/regressions.t >--- > catalogue/detail.pl | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index eb609bd6f2e..5892acc1d80 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -193,13 +193,16 @@ my $itemtypes = { map { $_->itemtype => $_ } @{ Koha::ItemTypes->search_with_loc > my $params; > my $patron = Koha::Patrons->find( $borrowernumber ); > $params->{ itemlost } = 0 if $patron->category->hidelostitems && !$showallitems; >-my $items = $biblio->items({ host_items => 1 })->search_ordered( $params, { prefetch => ['issue','current_branchtransfers'] } ); >+my $items_params = { >+ ( $invalid_marc_record ? () : ( host_items => 1 ) ), >+}; >+my $items = $biblio->items($items_params)->search_ordered( $params, { prefetch => ['issue','current_branchtransfers'] } ); > > # flag indicating existence of at least one item linked via a host record > my $hostrecords = $biblio->host_items->count; > > my $dat = &GetBiblioData($biblionumber); >-$dat->{'count'} = $biblio->items({ host_items => 1 })->count; >+$dat->{'count'} = $biblio->items($items_params)->count; > $dat->{'showncount'} = $items->count; > $dat->{'hiddencount'} = $dat->{'count'} - $dat->{'showncount'}; > >-- >2.25.1
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 33497
:
149467
|
149468
|
149573
|
149574
|
151861
|
151862
|
151863
|
151866
|
153046
|
153047
|
153048
|
153049
| 153183