From 473a2ec1cd866091a8f86371fc85294fbb5eedd3 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Mon, 2 Jul 2018 16:42:19 +1200 Subject: [PATCH] Bug 19532: Added conditional to check the recall has a status = 'W' before setting it to closed This solves a bug I found that if the same borrower number and itemnumber combination occur more than once in the recalls database table then when the item is checked out to the patron who recalled the item then the recall is not updated to have a status of closed. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand --- C4/Circulation.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 1e4e4de..60ec838 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1391,7 +1391,7 @@ sub AddIssue { # Check if a recall if ( C4::Context->preference('UseRecalls') ) { - my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'}, borrowernumber => $borrower->{'borrowernumber'} }); + my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'}, borrowernumber => $borrower->{'borrowernumber'}, status => 'W' }); if (defined $recall) { $recall->update({ status => 'F', old => 1 }); } -- 2.1.4