Bug 21075: AutoUnsuspendHolds should unsuspend holds <= today

To recreate:
 1 - Place a hold in your system
 2 - Set that hold (or all holds) to expire today
    update reserves set suspend_until=CONCAT( CURDATE()," 00:00:00");
 3 - Run misc/cronjobs/holds/auto_unsuspend_holds.p
 4 - Note the hold is sitll suspended
 5 - Visit /cgi-bin/koha/reserve/request.pl for the book with the hold
 6 - Note the suspend date is tomorrow (and cannot be set to today]
 7 - Click update holds - the date in db is now set to tomorrow
 8 - Reset to today
 9 - Apply patch
10 - Run the cron again
11 - Visit the page and note hold is unsuspended

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c0f7aed84d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9e67cff276)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Nick Clemens 2018-07-13 14:45:55 +00:00 committed by Fridolin Somers
parent ac56eda00a
commit 3908248f58
1 changed files with 1 additions and 1 deletions

View File

@ -842,7 +842,7 @@ Unsuspends all suspended reserves with a suspend_until date from before today.
sub AutoUnsuspendReserves {
my $today = dt_from_string();
my @holds = Koha::Holds->search( { suspend_until => { '<' => $today->ymd() } } );
my @holds = Koha::Holds->search( { suspend_until => { '<=' => $today->ymd() } } );
map { $_->suspend(0)->suspend_until(undef)->store() } @holds;
}