Bugzilla – Attachment 119220 Details for
Bug 28078
Add option to ignore hold counts when checking CanItemBeReserved
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28078: (follow-up) Add param check to 'itemAlreadyOnHold' test
Bug-28078-follow-up-Add-param-check-to-itemAlready.patch (text/plain), 2.26 KB, created by
Nick Clemens (kidclamp)
on 2021-04-06 13:22:12 UTC
(
hide
)
Description:
Bug 28078: (follow-up) Add param check to 'itemAlreadyOnHold' test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-04-06 13:22:12 UTC
Size:
2.26 KB
patch
obsolete
>From 79ca82f69e06e1da345906a207dcbc7eac2754cb Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 6 Apr 2021 13:21:50 +0000 >Subject: [PATCH] Bug 28078: (follow-up) Add param check to 'itemAlreadyOnHold' > test > >--- > C4/Reserves.pm | 2 +- > t/db_dependent/Holds.t | 10 +++++++++- > 2 files changed, 10 insertions(+), 2 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 2814e556fd..d48cd2b69c 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -394,7 +394,7 @@ sub CanItemBeReserved { > > # Check that the patron doesn't have an item level hold on this item already > return { status =>'itemAlreadyOnHold' } >- if Koha::Holds->search( { borrowernumber => $borrowernumber, itemnumber => $itemnumber } )->count(); >+ if ( !$params->{ignore_hold_counts} && Koha::Holds->search( { borrowernumber => $borrowernumber, itemnumber => $itemnumber } )->count() ); > > # Check that patron have not checked out this biblio (if AllowHoldsOnPatronsPossessions set) > if ( !C4::Context->preference('AllowHoldsOnPatronsPossessions') >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index 6f5497dd67..023c71d436 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -7,7 +7,7 @@ use t::lib::TestBuilder; > > use C4::Context; > >-use Test::More tests => 70; >+use Test::More tests => 72; > use MARC::Record; > > use C4::Biblio; >@@ -369,6 +369,14 @@ t::lib::Mocks::mock_preference( 'SkipHoldTrapOnNotForLoanValue', '-1' ); > ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item with notforloan value matching SkipHoldTrapOnNotForLoanValue" ); > t::lib::Mocks::mock_preference( 'SkipHoldTrapOnNotForLoanValue', '-1|1' ); > ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item with notforloan value matching SkipHoldTrapOnNotForLoanValue" ); >+is( >+ CanItemBeReserved( $borrowernumbers[0], $itemnumber)->{status}, 'itemAlreadyOnHold', >+ "cannot request item that you have already reservedd" >+); >+is( >+ CanItemBeReserved( $borrowernumbers[0], $item->itemnumber, undef, { ignore_hold_counts => 1 })->{status}, 'OK', >+ "can request item if we are not checking holds counts, but only if policy allows or forbids it" >+); > $hold->delete(); > > # Regression test for bug 9532 >-- >2.11.0
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 28078
:
119124
|
119143
|
119220
|
119263
|
119264