Bugzilla – Attachment 112402 Details for
Bug 26659
An item can be renewed even if there are holds waiting to be filled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26659: Fix incorrect comparison in checkout renewability
Bug-26659-Fix-incorrect-comparison-in-checkout-ren.patch (text/plain), 2.48 KB, created by
Chris Cormack
on 2020-10-24 21:22:35 UTC
(
hide
)
Description:
Bug 26659: Fix incorrect comparison in checkout renewability
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2020-10-24 21:22:35 UTC
Size:
2.48 KB
patch
obsolete
>From 3a82b781ca0e4f4531b36d42704f92243ed131e1 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@helsinki.fi> >Date: Mon, 12 Oct 2020 14:54:37 +0000 >Subject: [PATCH] Bug 26659: Fix incorrect comparison in checkout renewability > >The syntax used here was wrong and it allowed incorrectly to renew >checkouts which should not have been allowed because there were >holds waiting to be filled. This scenario can be reproduced at least >with using local hold groups. > >To test: > >1. In the circ rules for all libraries under "Default holds policy by item type" section > select for itemtype Book the policies "From local hold group" and "patron's hold group" >2. Enable AllowRenewalIfOtherItemsAvailable >3. Create local hold group for branch A and branch B (/cgi-bin/koha/admin/library_groups.pl) >4. Create biblio with 2 items of itemtype Book, one in branch A and other in B >5. Checkout item from branch A to patron PA >6. Create bib level hold for patron PB whose home library is branch A. >7. Try go to renew now the loan for patron PA and notice it would work >8. Apply patch >9. Try to go renew the loan for patron PA and notice it doesn't work. > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > C4/Circulation.pm | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 18c4dacda5..687d5bfb21 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2857,7 +2857,16 @@ sub CanBookBeRenewed { > for my $borrowernumber (@borrowernumbers) { > my $patron = $patrons{$borrowernumber} //= Koha::Patrons->find( $borrowernumber ); > next unless IsAvailableForItemLevelRequest($item, $patron); >- next unless CanItemBeReserved($borrowernumber,$itemnumber); >+ my $can_reserve = CanItemBeReserved($borrowernumber,$itemnumber); >+ # Allowing tooMany* and itemAlreadyOnHold because we need to ignore the count for existing holds. >+ my @allowed_statuses = ( >+ 'OK', >+ 'tooManyReserves', >+ 'tooManyHoldsForThisRecord', >+ 'tooManyReservesToday', >+ 'itemAlreadyOnHold' >+ ); >+ next unless grep { $_ eq $can_reserve->{status} } @allowed_statuses; > > push @reservable, $itemnumber; > if (@reservable >= @borrowernumbers) { >-- >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 26659
:
111517
|
111522
| 112402