From 918038904553ecd8572006abcb91f00bd92b4be4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 11 Nov 2015 14:26:51 +0000 Subject: [PATCH] Bug 14985: dbms expects a iso formatted date Signed-off-by: Tomas Cohen Arazi --- C4/Reserves.pm | 2 +- t/db_dependent/Holds.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index fc76fc1344..6ed1543917 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -1157,7 +1157,7 @@ sub ModReserve { if ( defined( $suspend_until ) ) { if ( $suspend_until ) { - $suspend_until = eval { output_pref( { dt => dt_from_string( $suspend_until ), dateonly => 1 }); }; + $suspend_until = eval { output_pref( { dt => dt_from_string( $suspend_until ), dateonly => 1, dateformat => 'iso' }); }; $dbh->do("UPDATE reserves SET suspend = 1, suspend_until = ? WHERE reserve_id = ?", undef, ( $suspend_until, $reserve_id ) ); } else { $dbh->do("UPDATE reserves SET suspend_until = NULL WHERE reserve_id = ?", undef, ( $reserve_id ) ); diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t index f219f879d3..8767223b06 100755 --- a/t/db_dependent/Holds.t +++ b/t/db_dependent/Holds.t @@ -137,7 +137,7 @@ ModReserve({ $reserve = GetReserve( $reserve_id ); ok( $reserve->{'priority'} eq '4', "Test GetReserve(), priority changed correctly" ); ok( $reserve->{'suspend'}, "Test GetReserve(), suspend hold" ); -ok( $reserve->{'suspend_until'} eq '2013-01-01 00:00:00', "Test GetReserve(), suspend until date" ); +is( $reserve->{'suspend_until'}, '2013-01-01 00:00:00', "Test GetReserve(), suspend until date" ); ToggleSuspend( $reserve_id ); $reserve = GetReserve( $reserve_id ); -- 2.39.5