From 55877cee635c43156434a6af1132825c25156a8c Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Mon, 2 Jan 2012 10:45:55 +0100 Subject: [PATCH] Bug 6132: Update sysprefs cache in set_preference Signed-off-by: Chris Cormack (cherry picked from commit b867d7d12adb98f42b473bc850927e1535a6ab6c) Signed-off-by: Chris Nighswonger (cherry picked from commit 11652d985458abbbe39cbf5dc52a50aa02fdb71c) Signed-off-by: Chris Nighswonger --- C4/Context.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/C4/Context.pm b/C4/Context.pm index 81facd6007..33075bb2e2 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -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; } -- 2.39.5