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 <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Magnus Enger 2023-05-03 08:51:14 +02:00 committed by Tomas Cohen Arazi
parent e3c31212df
commit 48a2952032
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 2 additions and 2 deletions

View File

@ -88,7 +88,7 @@ catch {
my $message = "Skipping execution of $0 ($_)";
print STDERR "$message\n"
if $verbose;
cronlogaction( $message );
cronlogaction({ info => $message });
exit;
};

View File

@ -80,7 +80,7 @@ catch {
my $message = "Skipping execution of $0 ($_)";
print STDERR "$message\n"
if $verbose;
cronlogaction( $message );
cronlogaction({ info => $message });
exit;
};