diff options
author | Marius Halden <marius.h@lden.org> | 2021-10-07 13:32:40 +0200 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2021-10-07 13:32:40 +0200 |
commit | 09dacfc6b8bf62addeee16c20b1d90c2a256da96 (patch) | |
tree | 7caa2bf9e92227ab74448f9b746dd28bbcb81b2a /perllib/FixMyStreet.pm | |
parent | 585e57484f9c6332668bf1ac0a6a3b39dbe32223 (diff) | |
parent | cea89fb87a96943708a1db0f646492fbfaaf000f (diff) |
Merge tag 'v3.1' into fiksgatami-devfiksgatami-dev
Diffstat (limited to 'perllib/FixMyStreet.pm')
-rw-r--r-- | perllib/FixMyStreet.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/perllib/FixMyStreet.pm b/perllib/FixMyStreet.pm index 94ba7685f..5b8dda079 100644 --- a/perllib/FixMyStreet.pm +++ b/perllib/FixMyStreet.pm @@ -97,6 +97,9 @@ sub override_config($&) { mySociety::MaPit::configure($config->{MAPIT_URL}) if $config->{MAPIT_URL}; + use Readonly; + Readonly my %ro_config => %$config; + # NB: though we have this, templates tend to use [% c.config %]. # This overriding happens after $c->config is set, so note that # FixMyStreet::App->setup_request rewrites $c->config if we are in @@ -106,8 +109,8 @@ sub override_config($&) { "FixMyStreet::config", sub { my ($class, $key) = @_; - return { %CONFIG, %$config } unless $key; - return $config->{$key} if exists $config->{$key}; + return { %CONFIG, %ro_config } unless $key; + return $ro_config{$key} if exists $ro_config{$key}; return $CONFIG{$key} if exists $CONFIG{$key}; } ); |