Bugzilla – Attachment 116609 Details for
Bug 27068
HoldsQueue doesn't know how to use holds groups
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27068: Fetch libraries once for speed
Bug-27068-Fetch-libraries-once-for-speed.patch (text/plain), 1.83 KB, created by
Martin Renvoize (ashimema)
on 2021-02-09 17:04:02 UTC
(
hide
)
Description:
Bug 27068: Fetch libraries once for speed
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-02-09 17:04:02 UTC
Size:
1.83 KB
patch
obsolete
>From e49be4fea36405129996845a6dfdd25f48139a6e Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 3 Dec 2020 06:48:13 -0500 >Subject: [PATCH] Bug 27068: Fetch libraries once for speed > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/HoldsQueue.pm | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index d4380ccfa8..b18adca6c1 100644 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -370,13 +370,15 @@ sub GetItemsAvailableToFillHoldRequestsForBib { > > =cut > >+our $libraries = {}; > sub _checkHoldPolicy { > my ($item, $request) = @_; > > return 0 unless $item->{holdallowed}; > return 0 if $item->{holdallowed} == 1 && $item->{homebranch} ne $request->{borrowerbranch}; > >- my $library = Koha::Libraries->find($item->{homebranch}); >+ $libraries->{$item->{homebranch}} ||= Koha::Libraries->find($item->{homebranch}); >+ my $library = $libraries->{$item->{homebranch}}; > > return 0 if $item->{'holdallowed'} == 3 && !$library->validate_hold_sibling({branchcode => $request->{borrowerbranch}}); > >@@ -386,7 +388,8 @@ sub _checkHoldPolicy { > return 0 if $hold_fulfillment_policy eq 'homebranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy}; > return 0 if $hold_fulfillment_policy eq 'holdingbranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy}; > >- my $patronLibrary = Koha::Libraries->find($request->{borrowerbranch}); >+ $libraries->{$request->{borrowerbranch}} ||= Koha::Libraries->find($request->{borrowerbranch}); >+ my $patronLibrary = $libraries->{$request->{borrowerbranch}}; > > return 0 if $hold_fulfillment_policy eq 'patrongroup' && !$patronLibrary->validate_hold_sibling({branchcode => $request->{branchcode}}); > >-- >2.20.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 27068
:
113900
|
114125
|
114140
|
114141
|
114142
|
115987
|
116022
|
116023
|
116024
|
116025
|
116026
|
116607
|
116608
| 116609 |
116610
|
116814
|
116815
|
116816
|
116817
|
117215