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 <gmc@esilibrary.com>
This commit is contained in:
Galen Charlton 2013-09-08 05:08:51 +00:00
parent 3c5e3170b9
commit b4c2ee3d9d
1 changed files with 4 additions and 4 deletions

View File

@ -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;
}