Bugzilla – Attachment 108787 Details for
Bug 18501
Automatic refunds need protection from failure
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18501: (follow-up) Add fallback to ItemHomeBranch
Bug-18501-follow-up-Add-fallback-to-ItemHomeBranch.patch (text/plain), 2.60 KB, created by
Martin Renvoize
on 2020-08-21 09:26:28 UTC
(
hide
)
Description:
Bug 18501: (follow-up) Add fallback to ItemHomeBranch
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2020-08-21 09:26:28 UTC
Size:
2.60 KB
patch
obsolete
>From 024c15dc3aa364826331cc20e03858e067e1a947 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 20 Aug 2020 14:02:35 +0100 >Subject: [PATCH] Bug 18501: (follow-up) Add fallback to ItemHomeBranch > >When 'RefundLostOnReturnControl' is set to 'CheckinLibrary' but >return_branch is passed as undefined we should fallback to >'ItemHomeBranch' before falling back to the default rule. >--- > t/db_dependent/Koha/CirculationRules.t | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Koha/CirculationRules.t b/t/db_dependent/Koha/CirculationRules.t >index 1473c235d7..9e3fb4439f 100644 >--- a/t/db_dependent/Koha/CirculationRules.t >+++ b/t/db_dependent/Koha/CirculationRules.t >@@ -379,7 +379,7 @@ subtest 'get_effective_daysmode' => sub { > }; > > subtest 'get_lostreturn_policy() tests' => sub { >- plan tests => 6; >+ plan tests => 7; > > $schema->storage->txn_begin; > >@@ -451,8 +451,8 @@ subtest 'get_lostreturn_policy() tests' => sub { > > my $item = $builder->build_sample_item( > { >- homebranch => $specific_rule_true->{branchcode}, >- holdingbranch => $specific_rule_false->{branchcode} >+ homebranch => $specific_rule_false->{branchcode}, >+ holdingbranch => $specific_rule_true->{branchcode} > } > ); > my $params = { >@@ -467,11 +467,11 @@ subtest 'get_lostreturn_policy() tests' => sub { > > t::lib::Mocks::mock_preference( 'RefundLostOnReturnControl', 'ItemHomeBranch' ); > is( Koha::CirculationRules->get_lostreturn_policy( $params ), >- 1,'Specific rule for home branch is applied (true)'); >+ 0,'Specific rule for home branch is applied (false)'); > > t::lib::Mocks::mock_preference( 'RefundLostOnReturnControl', 'ItemHoldingBranch' ); > is( Koha::CirculationRules->get_lostreturn_policy( $params ), >- 0,'Specific rule for holoding branch is applied (false)'); >+ 1,'Specific rule for holding branch is applied (true)'); > > # Default rule check > t::lib::Mocks::mock_preference( 'RefundLostOnReturnControl', 'CheckinLibrary' ); >@@ -499,5 +499,10 @@ subtest 'get_lostreturn_policy() tests' => sub { > is( Koha::CirculationRules->get_lostreturn_policy( $params ), > 1,'No rule for branch, no default rule, fallback default (true)'); > >+ # Fallback to ItemHoldBranch if CheckinLibrary is undefined >+ $params->{return_branch} = undef; >+ is( Koha::CirculationRules->get_lostreturn_policy( $params ), >+ 0,'return_branch undefined, fallback to ItemHomeBranch rule (false)'); >+ > $schema->storage->txn_rollback; > }; >-- >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 18501
:
108004
|
108005
|
108006
|
108121
|
108122
|
108123
|
108167
|
108168
|
108169
|
108170
|
108193
|
108194
|
108195
|
108243
|
108248
|
108249
|
108291
|
108292
|
108293
|
108294
|
108295
|
108296
|
108297
|
108298
|
108299
|
108300
|
108301
|
108482
|
108483
|
108484
|
108485
|
108486
|
108487
|
108488
|
108489
|
108490
|
108491
|
108492
|
108493
|
108494
|
108575
|
108576
|
108577
|
108578
|
108579
|
108580
|
108581
|
108582
|
108583
|
108584
|
108585
|
108586
|
108596
|
108597
|
108598
|
108599
|
108600
|
108601
|
108602
|
108603
|
108604
|
108605
|
108606
|
108607
|
108608
|
108610
|
108611
|
108612
|
108613
|
108614
|
108615
|
108616
|
108617
|
108618
|
108619
|
108620
|
108621
|
108717
|
108732
|
108738
|
108739
|
108740
|
108741
|
108784
|
108785
|
108786
| 108787 |
108788
|
108795
|
111295