Bugzilla – Attachment 190523 Details for
Bug 40435
Allow CanBookBeRenewed to consider future holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40435: Module changes
Bug-40435-Module-changes.patch (text/plain), 2.60 KB, created by
Nick Clemens (kidclamp)
on 2025-12-15 21:45:32 UTC
(
hide
)
Description:
Bug 40435: Module changes
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-12-15 21:45:32 UTC
Size:
2.60 KB
patch
obsolete
>From 1007af98c2c5756a93a9942f27151fe984e8ae6c Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 11 Dec 2025 14:08:00 +0100 >Subject: [PATCH] Bug 40435: Module changes > >CanBookBeRenewed will by default pass the skip_future_holds flag >to item->current_holds so that renewals are not blocked by future >holds. >The new pref FutureHoldsBlockRenewals allows you to change that >historical behavior. > >Test plan: >[1] Set pref ConfirmFutureHolds=3, FutureHoldsBlockRenewals=Allow, > OPACAllowHoldDateInFuture=Allow >[2] Checkout some item to patron A. >[3] Place hold on same item for patron B, reserve date tomorrow. >[4] Try to renew item with patron A on account page. Should be > marked as Not renewable. >[5] Set pref FutureHoldsBlockRenewals=Dont >[6] Repeat step 4. Renew should be allowed. >[7] prove t/db_dependent/Holds.t t/db_dependent/Reserves.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Circulation.pm | 6 ++++-- > Koha/Item.pm | 5 ++++- > 2 files changed, 8 insertions(+), 3 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 0b2b57e3754..163e1560d1f 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -3269,9 +3269,11 @@ sub CanBookBeRenewed { > } > > # There is an item level hold on this item, no other item can fill the hold >- # The flag skip_future_holds may be removed in the future. See bug 40435. >+ # The flag skip_future_holds is set when preference FutureHoldsBlockRenewals is not set (default). >+ # (Historically, Koha does not block renewals for future holds. Could be argued.) >+ my $skip = C4::Context->preference('FutureHoldsBlockRenewals') ? 0 : 1; > return ( 0, "on_reserve" ) >- if ( $item->current_holds( { skip_future_holds => 1 } )->search( { non_priority => 0 } )->count ); >+ if ( $item->current_holds( { skip_future_holds => $skip } )->search( { non_priority => 0 } )->count ); > > my ( $status, $matched_reserve, $possible_holds ) = C4::Reserves::CheckReserves($item); > my @fillable_holds = (); >diff --git a/Koha/Item.pm b/Koha/Item.pm >index d2b92c19568..865acdb578b 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -1181,7 +1181,10 @@ sub article_request_type { > my $holds = $item->current_holds > > Return the holds placed on this item. >-Respects the lookahead days in ConfirmFutureHolds pref. >+Respects the lookahead days in preference ConfirmFutureHolds when the >+param skip_future_holds is not set. >+Note that the preference FutureHoldsBlockRenewals controls that setting >+for renewals; see also C4::Circulation::CanBookBeRenewed. > > =cut > >-- >2.39.5
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 40435
:
190449
|
190450
|
190451
|
190452
|
190453
|
190520
|
190521
|
190522
|
190523
|
190524
|
190671
|
190672
|
190673
|
190674
|
190675
|
190676
|
190677