Bug 6132: Update sysprefs cache in set_preference

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
(cherry picked from commit b867d7d12a)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
This commit is contained in:
Julian Maurice 2012-01-02 10:45:55 +01:00 committed by Chris Nighswonger
parent dbad13ba5d
commit 11652d9854
1 changed files with 4 additions and 2 deletions

View File

@ -549,7 +549,7 @@ the sysprefs cache.
sub set_preference {
my $self = shift;
my $var = shift;
my $var = lc(shift);
my $value = shift;
my $dbh = C4::Context->dbh or return 0;
@ -565,7 +565,9 @@ sub set_preference {
ON DUPLICATE KEY UPDATE value = VALUES(value)
" );
$sth->execute( $var, $value );
if($sth->execute( $var, $value )) {
$sysprefs{$var} = $value;
}
$sth->finish;
}