Bugzilla – Attachment 130771 Details for
Bug 29703
Simplify GetBranchItemRule using get_effective_rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29703: Use get_effective_rules in GetBranchItemRule
Bug-29703-Use-geteffectiverules-in-GetBranchItemRu.patch (text/plain), 2.21 KB, created by
Michal Denar
on 2022-02-17 21:33:50 UTC
(
hide
)
Description:
Bug 29703: Use get_effective_rules in GetBranchItemRule
Filename:
MIME Type:
Creator:
Michal Denar
Created:
2022-02-17 21:33:50 UTC
Size:
2.21 KB
patch
obsolete
>From 0e568914e5c3413714fdccfbe4c3d0b07e36b2e5 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 15 Dec 2021 16:27:18 +0000 >Subject: [PATCH] Bug 29703: Use get_effective_rules in GetBranchItemRule > >To test: >1 - prove -v t/db_dependent/Circulation/Branch.t > >Signed-off-by: Michal Denar <black23@gmail.com> >--- > C4/Circulation.pm | 39 ++++++++------------------------------- > 1 file changed, 8 insertions(+), 31 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 17cab0c74b..b55509cb37 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1845,39 +1845,16 @@ sub GetBranchItemRule { > my ( $branchcode, $itemtype ) = @_; > > # Search for rules! >- my $holdallowed_rule = Koha::CirculationRules->get_effective_rule( >- { >- branchcode => $branchcode, >- itemtype => $itemtype, >- rule_name => 'holdallowed', >- } >- ); >- my $hold_fulfillment_policy_rule = Koha::CirculationRules->get_effective_rule( >- { >- branchcode => $branchcode, >- itemtype => $itemtype, >- rule_name => 'hold_fulfillment_policy', >- } >- ); >- my $returnbranch_rule = Koha::CirculationRules->get_effective_rule( >- { >- branchcode => $branchcode, >- itemtype => $itemtype, >- rule_name => 'returnbranch', >- } >- ); >+ my $rules = Koha::CirculationRules->get_effective_rules({ >+ branchcode => $branchcode, >+ itemtype => $itemtype, >+ rules => ['holdallowed', 'hold_fulfillment_policy', 'returnbranch'] >+ }); > > # built-in default circulation rule >- my $rules; >- $rules->{holdallowed} = defined $holdallowed_rule >- ? $holdallowed_rule->rule_value >- : 'from_any_library'; >- $rules->{hold_fulfillment_policy} = defined $hold_fulfillment_policy_rule >- ? $hold_fulfillment_policy_rule->rule_value >- : 'any'; >- $rules->{returnbranch} = defined $returnbranch_rule >- ? $returnbranch_rule->rule_value >- : 'homebranch'; >+ $rules->{holdallowed} //= 'from_any_library'; >+ $rules->{hold_fulfillment_policy} //= 'any'; >+ $rules->{returnbranch} //= 'homebranch'; > > return $rules; > } >-- >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 29703
:
128574
|
130771
|
130812