From 291ed5a957e70e06e30d30d74b2c62b17f2dceea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20Rodr=C3=ADguez?= Date: Fri, 23 May 2025 10:04:24 +0200 Subject: [PATCH] Bug 39977 - Prevent reserves of items the users have already on their possession This patch preventes users from placing a hold on item they haved checked out. 1 Turn system preference AllowHoldsOnPatronsPossessions to Allow. 2 Check out an item from a record with more than one item. 3 Try to put a hold on that record with the same user that checked out the item. You will see that you can select the item the user already has. 4 Apply patch, restart services 5 Repeat step 3. Now you cannot select the item the user has checked out. --- C4/Reserves.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index cadd4d413e..26c99b4dbf 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -512,6 +512,11 @@ sub CanItemBeReserved { && C4::Circulation::CheckIfIssuedToPatron( $patron->borrowernumber, $item->biblionumber ) ) { return _cache { status => 'alreadypossession' }; + } elsif($item && $patron) { + my $issue = $item->checkout; + if ($issue && $issue->borrowernumber == $patron->borrowernumber) { + return _cache { status => 'alreadypossession' }; + } } # check if a recall exists on this item from this borrower -- 2.30.2