Bugzilla – Attachment 130832 Details for
Bug 30085
Improve performance of CanItemBeReserved
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30085: Move IndependentBranches check sooner
Bug-30085-Move-IndependentBranches-check-sooner.patch (text/plain), 1.95 KB, created by
Martin Renvoize (ashimema)
on 2022-02-18 12:34:18 UTC
(
hide
)
Description:
Bug 30085: Move IndependentBranches check sooner
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-02-18 12:34:18 UTC
Size:
1.95 KB
patch
obsolete
>From 0761279c8b4c9b1c6f2da400485c1555fa646065 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 11 Feb 2022 19:56:42 +0000 >Subject: [PATCH] Bug 30085: Move IndependentBranches check sooner > >This doesn't rely on the other statuses, and requires only cached >preference check, so lets allow the possibiliy of an early exit > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Reserves.pm | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 9eb9a35fed..a5e41b8c91 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -385,6 +385,16 @@ sub CanItemBeReserved { > my $ruleitemtype; # itemtype of the matching issuing rule > my $allowedreserves = 0; # Total number of holds allowed across all records, default to none > >+ # We check item branch if IndependentBranches is ON >+ # and canreservefromotherbranches is OFF >+ if ( C4::Context->preference('IndependentBranches') >+ and !C4::Context->preference('canreservefromotherbranches') ) >+ { >+ if ( $item->homebranch ne $patron->branchcode ) { >+ return { status => 'cannotReserveFromOtherBranches' }; >+ } >+ } >+ > # we retrieve borrowers and items informations # > # item->{itype} will come for biblioitems if necessery > my $biblio = $item->biblio; >@@ -554,16 +564,6 @@ sub CanItemBeReserved { > } > } > >- # If reservecount is ok, we check item branch if IndependentBranches is ON >- # and canreservefromotherbranches is OFF >- if ( C4::Context->preference('IndependentBranches') >- and !C4::Context->preference('canreservefromotherbranches') ) >- { >- if ( $item->homebranch ne $patron->branchcode ) { >- return { status => 'cannotReserveFromOtherBranches' }; >- } >- } >- > if ($pickup_branchcode) { > my $destination = Koha::Libraries->find({ > branchcode => $pickup_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 30085
:
130525
|
130526
|
130527
|
130528
|
130829
|
130830
|
130831
|
130832
|
130856
|
130857
|
130858
|
130859
|
138058