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:
parent
3c5e3170b9
commit
b4c2ee3d9d
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue