Skip to content

Commit

Permalink
Bug 33649: Fix use of cronlogaction
Browse files Browse the repository at this point in the history
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 <[email protected]>

Signed-off-by: Jonathan Druart <[email protected]>
Signed-off-by: Tomas Cohen Arazi <[email protected]>
  • Loading branch information
MagnusEnger authored and tomascohen committed May 5, 2023
1 parent e3c3121 commit 48a2952
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion misc/cronjobs/fines.pl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
my $message = "Skipping execution of $0 ($_)";
print STDERR "$message\n"
if $verbose;
cronlogaction( $message );
cronlogaction({ info => $message });
exit;
};

Expand Down
2 changes: 1 addition & 1 deletion misc/cronjobs/process_message_queue.pl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
my $message = "Skipping execution of $0 ($_)";
print STDERR "$message\n"
if $verbose;
cronlogaction( $message );
cronlogaction({ info => $message });
exit;
};

Expand Down

0 comments on commit 48a2952

Please sign in to comment.