From 0ba2ce047b58f92aaef74380c8e10afbc33970cb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Mon, 11 Dec 2017 08:41:05 +0100 Subject: [PATCH] Bug 19788: Preserve case sensitivity when creating Local preferences Fix a bug tranforming new local preference variable name in lowercase. TO TEST: 1. Admin > System preferences > Local use 2. Button New preference. Fill variable field with 'TESTfoo'. Click Save. 3. The new variable is named: 'testfoo'. 4. Apply the patch. 5. Button New preference. Fill variable field with 'TESTfoo2'. Click Save. 6. The new variable is properly named: 'TESTfoo2'. Signed-off-by: Claire Gravely Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens (cherry picked from commit 5ff8eca26c8d42cbca1c1e8b6b4ee10f2c45a387) Signed-off-by: Fridolin Somers --- C4/Context.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/Context.pm b/C4/Context.pm index 1aa08be050..1eb5f88902 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -496,6 +496,7 @@ preference. sub set_preference { my ( $self, $variable, $value, $explanation, $type, $options ) = @_; + my $variable_case = $variable; $variable = lc $variable; my $syspref = Koha::Config::SysPrefs->find($variable); @@ -521,7 +522,7 @@ sub set_preference { )->store; } else { $syspref = Koha::Config::SysPref->new( - { variable => $variable, + { variable => $variable_case, value => $value, explanation => $explanation || undef, type => $type, -- 2.39.5