From 2d3b25b04ea6a47ed0f5ebdc3e10fb16b474184f Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 10 May 2018 08:12:04 -0400 Subject: [PATCH] Bug 20724: Correctly mark an hold as waiting - ReservesNeedReturns MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We need to call Koha::Hold->set_waiting to correctly calculate the expiration date. It fixes a regression introduced by commit 26634151dbce0bf39ff6c9eda5b58bb993996a2d Bug 12063 - Fix QA failures The expiration date has to be set for waiting holds == Test plan (time to execute: less than 4min) == 1. Set ReservesNeedReturns to "Don't automatically" 2. Place a hold on a specific item 3. Check it in and confirm hold 4. The hold should have an expiration date record page → Hold → "Expiration" column 5. It should be listed in staff:/cgi-bin/koha/circ/waitingreserves.pl 6. Set ReservesNeedReturns to "Automatically" 7. Place a hold on a specific item (which should also behave like we check the item in to keep it for the patron) 8. The hold should have an *empty* expiration date record page → Hold → "Expiration" column 9. Holds awaiting pickup page should crash staff:/cgi-bin/koha/circ/waitingreserves.pl 10. Cancel the hold to remove the corrupted data record page → Hold → the red X 11. Apply this patch 12. Place a hold on a specific item 13. The hold should have an expiration date (not empty) 14. It should be listed in staff:/cgi-bin/koha/circ/waitingreserves.pl 15. Celebrate! Signed-off-by: Victor Grousset Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart (cherry picked from commit c585f1149770ec401f188e061211501897cec0bf) Signed-off-by: Fridolin Somers --- C4/Reserves.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index f7e8f9b0c6..a46c8666b2 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -206,6 +206,7 @@ sub AddReserve { itemtype => $itemtype, } )->store(); + $hold->set_waiting() if $found eq 'W'; logaction( 'HOLDS', 'CREATE', $hold->id, Dumper($hold->unblessed) ) if C4::Context->preference('HoldsLog'); -- 2.39.5