From b4c2ee3d9d22d1be93b6dfca5c251a03ec120125 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Sun, 8 Sep 2013 05:08:51 +0000 Subject: [PATCH] Bug 10325: (follow-up) restore case-insensivity of syspref cache Case-insensitivity of the system preference cache was introduced in the patch for bug 6132. This patch corrects some breakage that occurred. Longer-term, IMO a hard look needs to be taken at using a case-insensitive collation for syspref codes, and coded values in general. Signed-off-by: Galen Charlton --- C4/Context.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Context.pm b/C4/Context.pm index 7bc709794b..739a0ec973 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -542,8 +542,8 @@ sub preference { my $self = shift; my $var = shift; # The system preference to return - if ($use_syspref_cache && exists $sysprefs{$var}) { - return $sysprefs{$var}; + if ($use_syspref_cache && exists $sysprefs{lc $var}) { + return $sysprefs{lc $var}; } my $dbh = C4::Context->dbh or return 0; @@ -559,10 +559,10 @@ sub preference { WHERE variable = ? LIMIT 1 }; - $value = $dbh->selectrow_array( $sql, {}, $var ); + $value = $dbh->selectrow_array( $sql, {}, lc $var ); } - $sysprefs{$var} = $value; + $sysprefs{lc $var} = $value; return $value; } -- 2.39.5