From 57cceec6bc59561b7bf7370ee568398315efa783 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 3 Jun 2026 16:35:06 +0100 Subject: [PATCH] Bug 42766: Add ScriptLog system preference Adds a new YesNo system preference 'ScriptLog' in the Logging section of system preferences, adjacent to CronjobLog. When enabled, the start and end of non-cron Koha scripts (those using bare 'use Koha::Script' rather than 'use Koha::Script -cron') will be recorded in the action log under the SCRIPTS module. Signed-off-by: David Nind Signed-off-by: Nick Clemens Signed-off-by: Pedro Amorim --- .../data/mysql/atomicupdate/bug_42766.pl | 19 +++++++++++++++++++ .../en/modules/admin/preferences/logs.pref | 6 ++++++ 2 files changed, 25 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_42766.pl diff --git a/installer/data/mysql/atomicupdate/bug_42766.pl b/installer/data/mysql/atomicupdate/bug_42766.pl new file mode 100755 index 0000000000..4624f7e814 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_42766.pl @@ -0,0 +1,19 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "42766", + description => "Add ScriptLog system preference", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do( + q{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) + VALUES ( 'ScriptLog', '0', '', 'If enabled, log the start and end of non-cron Koha scripts to the action log (module: SCRIPTS).', 'YesNo' ) + } + ); + say_success( $out, "Added new system preference 'ScriptLog'" ); + }, +}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref index 7e975f583a..4de4e31185 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref @@ -90,6 +90,12 @@ Logging: 1: Log 0: "Don't log" - information from cron jobs. + - + - pref: ScriptLog + choices: + 1: Log + 0: "Don't log" + - the start and end of non-cron Koha scripts. - - pref: ReportsLog choices: