Bugzilla – Attachment 103251 Details for
Bug 22005
System preference DecreaseLoanHighHolds incorrectly counts the number of holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22005 - DecreaseLoanHighHolds counts holds wrong
Bug-22005---DecreaseLoanHighHolds-counts-holds-wro.patch (text/plain), 2.24 KB, created by
Magnus Enger
on 2020-04-20 09:36:58 UTC
(
hide
)
Description:
Bug 22005 - DecreaseLoanHighHolds counts holds wrong
Filename:
MIME Type:
Creator:
Magnus Enger
Created:
2020-04-20 09:36:58 UTC
Size:
2.24 KB
patch
obsolete
>From 7d5a9e2caf8eadc23506dfd8ead656d786e7c471 Mon Sep 17 00:00:00 2001 >From: Magnus Enger <magnus@libriotech.no> >Date: Mon, 20 Apr 2020 11:22:11 +0200 >Subject: [PATCH] Bug 22005 - DecreaseLoanHighHolds counts holds wrong > >There is a small error in how holds are compared to thresholds in >the code related to DecreaseLoanHighHolds. This should fix the >problem. > >To test: >- Apply the first patch from this bug, which fleshes out the tests > a bit. Run the tests with something like this: > $ sudo koha-shell -c "prove -v t/db_dependent/DecreaseLoanHighHolds.t" kohadev > The tests should fail >- Read through the tests and comments and make sure you agree they > make sense >- Apply this second patch >- Run prove on the tests again >- Check that all tests pass >--- > C4/Circulation.pm | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index faaa2692e8..ca9529be54 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1205,8 +1205,12 @@ sub checkHighHolds { > > # static means just more than a given number of holds on the record > >- # If the number of holds is less than the threshold, we can stop here >- if ( $holds->count() < $decreaseLoanHighHoldsValue ) { >+ # If the number of holds is less than or equal to the threshold, we can stop here >+ # The sysprefs say: "[Enable] the reduction of loan period to [x] days for high >+ # demand items with *more than* [y] holds [on the record]." >+ # This must mean that if the number of holds and the value of >+ # decreaseLoanHighHoldsValue are equal, checkHighHolds should NOT be triggered >+ if ( $holds->count() <= $decreaseLoanHighHoldsValue ) { > return $return_data; > } > } >@@ -1229,7 +1233,7 @@ sub checkHighHolds { > > my $threshold = $items_count + $decreaseLoanHighHoldsValue; > >- # If the number of holds is less than the count of items we have >+ # If the number of holds is less than or equal to the count of items we have > # plus the number of holds allowed above that count, we can stop here > if ( $holds->count() <= $threshold ) { > return $return_data; >-- >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 22005
:
103250
| 103251