From f7c5a910ded2bc15ccc2fa9cea557c61d7989f10 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 11 Feb 2019 16:05:23 -0300 Subject: [PATCH] Bug 21765: Make AutoUnsuspendReserves call Koha::Hold->resume This patch makes the mentioned method use the biult-in method for resuming a suspended hold, instead of manually setting the specific attributes using the accessors. The side effect for this is that HoldsLog is now honoured. This patchset also refactors the tests a bit so they rely on the exposed methods and thus don't rely on specific implementation details (like suspended hold means a date in suspended_until plus suspended=1). To test: - Apply the regression tests patch - Run: $ kshell k$ prove t/db_dependent/Reserves/AutoUnsuspendReserves.t => FAIL: It fails loudly because things are done manually - Apply this patch - Run: k$ prove t/db_dependent/Reserves/AutoUnsuspendReserves.t => SUCCESS: Tests pass! Signed-off-by: Kyle M Hall Signed-off-by: Josef Moravec Signed-off-by: Nick Clemens (cherry picked from commit 7c3a5c78c1aacbdb0ad7eb758cb9880ecefcce3a) Signed-off-by: Martin Renvoize (cherry picked from commit 7609009a7319ad6e631bac6fd39a8a5397566782) Signed-off-by: Jesse Maseto --- C4/Reserves.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index ab901c8953..4c30ec9faa 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -806,7 +806,7 @@ sub AutoUnsuspendReserves { my @holds = Koha::Holds->search( { suspend_until => { '<=' => $today->ymd() } } ); - map { $_->suspend(0)->suspend_until(undef)->store() } @holds; + map { $_->resume() } @holds; } =head2 ModReserve -- 2.39.5