From fdd3102c3a1a55d18335bb9a11cea95a1d195936 Mon Sep 17 00:00:00 2001 From: Didier Gautheron Date: Thu, 29 Apr 2021 10:19:22 +0200 Subject: [PATCH] Bug 28259: (bug 21944 follow-up) if a waiting hold is reverted recheck reserve To test: 1) Set HoldsAutoFill 2) double check hold rules are on next available item. 3) At midway check out barcode 39999000010831 to 23529000035676 patron ( Henry Acevedo) 4) hold next available to Ronnie Ballard (23529000139858) 5) check in 39999000010831, item is in waiting hold state 6) At Centerville check in 39999000010831 --> internal server error 7) Reset database 8) Redo 1) to 5) 9) At Centerville check in 39999000010831, item is in transfert with a hold Signed-off-by: Victor Grousset/tuxayo --- C4/Circulation.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 10db0d226a..a908b69fa5 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2224,9 +2224,9 @@ sub AddReturn { ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->itemnumber, undef, $lookahead ) unless ( $item->withdrawn ); # if a hold is found and is waiting at another branch, change the priority back to 1 and trigger the hold (this will trigger a transfer and update the hold status properly) if ( $resfound and $resfound eq "Waiting" and $branch ne $resrec->{branchcode} ) { - my $hold = C4::Reserves::RevertWaitingStatus( { itemnumber => $item->itemnumber } ); - $resfound = 'Reserved'; - $resrec = $hold->unblessed; + C4::Reserves::RevertWaitingStatus( { itemnumber => $item->itemnumber } ); + #If the hold is reverted we need to refetch for the return values + ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->itemnumber, undef, $lookahead ) unless ( $item->withdrawn ); } if ($resfound) { $resrec->{'ResFound'} = $resfound; -- 2.31.1