Bugzilla – Attachment 150782 Details for
Bug 33691
Improve query for do_check_for_previous_checkout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33691: Improve query for do_check_for_previous_checkout
Bug-33691-Improve-query-for-docheckforpreviouschec.patch (text/plain), 1.55 KB, created by
Kyle M Hall (khall)
on 2023-05-05 17:52:50 UTC
(
hide
)
Description:
Bug 33691: Improve query for do_check_for_previous_checkout
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-05-05 17:52:50 UTC
Size:
1.55 KB
patch
obsolete
>From c7fc22307f7d6ace6bfac77002c5ed79d59bc11c Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 5 May 2023 13:51:43 -0400 >Subject: [PATCH] Bug 33691: Improve query for do_check_for_previous_checkout > >do_check_for_previous_checkout will pass a list of itemnumbers as part of the query. This could be hundreds of items or more. It makes sense to check by biblionumber instead when possible. > >Test Plan: >1) prove t/db_dependent/Patron/Borrower_PrevCheckout.t >2) Apply this patch >3) prove t/db_dependent/Patron/Borrower_PrevCheckout.t >4) Test still pass! >--- > Koha/Patron.pm | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index e28d892af9..de73caa923 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -726,10 +726,7 @@ $PATRON, 0 otherwise. > sub do_check_for_previous_checkout { > my ( $self, $item ) = @_; > >- my $criteria = { >- borrowernumber => $self->borrowernumber, >- itemnumber => \@item_nos, >- }; >+ my $criteria = { borrowernumber => $self->borrowernumber }; > > my $attrs = {}; > >@@ -740,8 +737,8 @@ sub do_check_for_previous_checkout { > } else { > # Get all itemnumbers for given bibliographic record. > @item_nos = $biblio->items->get_column( 'itemnumber' ); >- $criteria->{biblionumber} = $item->{biblionumber}; >- $attrs->{join} = 'biblio'; >+ $criteria->{'biblio.biblionumber'} = $item->{biblionumber}; >+ $attrs->{join} = { 'item' => 'biblio' }; > } > > # Create (old)issues search criteria >-- >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 33691
:
150782
|
150783
|
150784
|
150785
|
150818