Bugzilla – Attachment 128574 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.16 KB, created by
Nick Clemens (kidclamp)
on 2021-12-15 16:28:32 UTC
(
hide
)
Description:
Bug 29703: Use get_effective_rules in GetBranchItemRule
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-12-15 16:28:32 UTC
Size:
2.16 KB
patch
obsolete
>From 8ee533dadb6ddffce051861280f3ecc145c4c26f 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 >--- > C4/Circulation.pm | 39 ++++++++------------------------------- > 1 file changed, 8 insertions(+), 31 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index c2edf81f94..bc8894f849 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1846,39 +1846,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.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 29703
:
128574
|
130771
|
130812