Bug 33649: Fix use of cronlogaction
authorMagnus Enger <magnus@libriotech.no>
Wed, 3 May 2023 06:51:14 +0000 (08:51 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 5 May 2023 13:18:37 +0000 (10:18 -0300)
commit48a2952032bafde7041e7bf10d861e7efeff54fc
tree900d05d4c999449e50e8ae42b9b653cbbccbafe6
parente3c31212df4d1917004a20998f47777ef0aea35d
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>
misc/cronjobs/fines.pl
misc/cronjobs/process_message_queue.pl