From 59fe7dfd7fa6d31c30f3458af05510041ba529e0 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 24 Feb 2015 19:00:51 -0800 Subject: [PATCH] avoid warnings in all non-web UI code with new conf cache, github#38, RT#33683 --- FS/FS/Conf.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index e20474743..838b9cbf7 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -23,6 +23,8 @@ $base_dir = '%%%FREESIDE_CONF%%%'; $DEBUG = 0; +$conf_cache_enabled = 0; + =head1 NAME FS::Conf - Freeside configuration values @@ -123,7 +125,8 @@ sub _config { my($self,$name,$agentnum,$agentonly)=@_; my $hashref = { 'name' => $name }; local $FS::Record::conf = undef; # XXX evil hack prevents recursion - $conf_cache = undef unless $conf_cache_enabled; # use cache only when it is safe to do so + $conf_cache = undef unless $conf_cache_enabled; # use cache only when it is + # safe to do so my $cv; my @a = ( ($agentnum || ()), @@ -140,7 +143,8 @@ sub _config { my $key = join(':',$name, $a, $l); if (! exists $conf_cache->{$key}){ $hashref->{locale} = $l; - # $conf_cache is reset in FS::UID during myconnect, so the cache is reset per connection + # $conf_cache is reset in FS::UID during myconnect, so the cache is + # reset per connection $conf_cache->{$key} = FS::Record::qsearchs('conf', $hashref); } return $conf_cache->{$key} if $conf_cache->{$key}; -- 2.11.0