From 4f01cac32701c3d9786c472f3bacd21e34231d7e Mon Sep 17 00:00:00 2001 From: Magnus Enger Date: Wed, 3 May 2023 08:51:14 +0200 Subject: [PATCH] Bug 33649: Fix use of cronlogaction C4::Log::cronlogaction() takes a hashref as argument, with "info" and possibly "action" as keys. But there are a couple of places where it is called with just a string as argument, and that does not work. Both places need lock_exec to fail to trigger the error. I have seen this on a production server, but not been able to reproduce in ktd. To test: - Run this on the Koha repo: grep -r "cronlogaction(" * - Verify that fines.pl and process_message_queue.pl are the only scripts that call cronlogaction without a hashref as argument, but do it like this: cronlogaction( $message ); - Apply this patch - Run the grep again and verify that all calls to cronlogaction now take a hashref as argument Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- misc/cronjobs/fines.pl | 2 +- misc/cronjobs/process_message_queue.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/cronjobs/fines.pl b/misc/cronjobs/fines.pl index b141c557239..75adbe0d7af 100755 --- a/misc/cronjobs/fines.pl +++ b/misc/cronjobs/fines.pl @@ -88,7 +88,7 @@ catch { my $message = "Skipping execution of $0 ($_)"; print STDERR "$message\n" if $verbose; - cronlogaction( $message ); + cronlogaction({ info => $message }); exit; }; diff --git a/misc/cronjobs/process_message_queue.pl b/misc/cronjobs/process_message_queue.pl index 9250ec503a8..797567c1c2b 100755 --- a/misc/cronjobs/process_message_queue.pl +++ b/misc/cronjobs/process_message_queue.pl @@ -80,7 +80,7 @@ catch { my $message = "Skipping execution of $0 ($_)"; print STDERR "$message\n" if $verbose; - cronlogaction( $message ); + cronlogaction({ info => $message }); exit; }; -- 2.25.1