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 <claire.gravely@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Frédéric Demians 2017-12-11 08:41:05 +01:00 committed by Nick Clemens
parent ab7ea3ff38
commit 5ff8eca26c
1 changed files with 2 additions and 1 deletions

View File

@ -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,