From dc357552386dbe9ae08035ccc126b2dde7eb52cb Mon Sep 17 00:00:00 2001 From: David Gustafsson Date: Thu, 4 May 2023 17:51:44 +0200 Subject: [PATCH] Bug 32478: Fix handling of undef values in ItemsDeniedRenewal Signed-off-by: Nick Clemens Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- ...NULL_values_in_syspref_ItemsDeniedRenewal.pl | 17 +++++++++++++++++ .../modules/admin/preferences/circulation.pref | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_32478-fix_NULL_values_in_syspref_ItemsDeniedRenewal.pl diff --git a/installer/data/mysql/atomicupdate/bug_32478-fix_NULL_values_in_syspref_ItemsDeniedRenewal.pl b/installer/data/mysql/atomicupdate/bug_32478-fix_NULL_values_in_syspref_ItemsDeniedRenewal.pl new file mode 100755 index 0000000000..d7c67b6bc8 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_32478-fix_NULL_values_in_syspref_ItemsDeniedRenewal.pl @@ -0,0 +1,17 @@ +use Modern::Perl; +use C4::Context; + +return { + bug_number => "32478", + description => "Remove usage of Koha::Config::SysPref->find since bypasses cache", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + $dbh->do(q{UPDATE `systempreferences` SET `value` = REPLACE(`value`, 'NULL', 'null') WHERE `variable` = 'ItemsDeniedRenewal'}); + say $out "Replace 'NULL' with 'null' in ItemsDeniedRenewal system preference"; + + C4::Context->clear_syspref_cache(); + say $out "Clear system preference cache"; + }, +}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 6c3ee2c27b..c5308a8506 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -540,9 +540,9 @@ Circulation: - "
Can name any field in the items table followed by a colon then a space then" - "a bracketed list of values separated by commas." - "For example:" - - "
ccode: [NEWFIC,NULL,DVD]" + - "
ccode: [NEWFIC,null,DVD]" - "
itype: [NEWBK,\"\"]" - - "
NOTE: The word 'NULL' can be used to block renewal on undefined fields, while an empty string \"\" will block on an empty (but defined) field." + - "
NOTE: The word 'null' can be used to block renewal on undefined fields, while an empty string \"\" will block on an empty (but defined) field." - - pref: UpdateNotForLoanStatusOnCheckout type: textarea -- 2.39.5