From c45fd14707a8b0ff9c3cdbf3d91cca977c86bb36 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 15 May 2019 20:02:37 -0500 Subject: [PATCH] Bug 22917: Fix more funky things And that's where a land. We are making another test failing much more often than before. The 'now' mocked will be far before the now() of mysql from the tests executed at the end of Circulation.t Without this patch I get the following error one out of the two runs: # Failed test 'renew log successfully added' # at t/db_dependent/Circulation.t line 3024. # got: '4' # expected: '5' # Looks like you failed 1 test of 13. Using the mocked value will solve this issue. I cannot find any side-effects this change could cause. --- C4/Log.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Log.pm b/C4/Log.pm index 34e2b609c2..8450a4a68a 100644 --- a/C4/Log.pm +++ b/C4/Log.pm @@ -77,9 +77,10 @@ sub logaction { $usernumber ||= 0; $interface //= C4::Context->interface; + my $now = dt_from_string; my $dbh = C4::Context->dbh; - my $sth=$dbh->prepare("Insert into action_logs (timestamp,user,module,action,object,info,interface) values (now(),?,?,?,?,?,?)"); - $sth->execute($usernumber,$modulename,$actionname,$objectnumber,$infos,$interface); + my $sth=$dbh->prepare("Insert into action_logs (timestamp,user,module,action,object,info,interface) values (?,?,?,?,?,?,?)"); + $sth->execute($now, $usernumber,$modulename,$actionname,$objectnumber,$infos,$interface); $sth->finish; my $logger = Koha::Logger->get( -- 2.11.0