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