diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-04-01 08:06:51 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-04-01 08:06:52 +0100 |
commit | a978974b5770ebc173d302034cbe179a45cb40d5 (patch) | |
tree | 10c9e1721c9d8e8bd15c0ca6b5d8b56752e4d437 /perllib/FixMyStreet/App/Controller/Reports.pm | |
parent | 83bb5ff481d87e4cc4a713d69e3765d2d2c16392 (diff) |
Make sure MapIt generation always used if given.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Reports.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Reports.pm | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm index b77e89d0e..751870bd4 100644 --- a/perllib/FixMyStreet/App/Controller/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Reports.pm @@ -219,10 +219,12 @@ sub rss_area_ward : Path('/rss/area') : Args(2) { # We're checking an area here, but this function is currently doing that. return if $c->cobrand->reports_body_check( $c, $area ); + my %params = ( type => $c->cobrand->area_types ); + $params{generation} = $c->config->{MAPIT_GENERATION} + if $c->config->{MAPIT_GENERATION}; + # We must now have a string to check on mapit - my $areas = mySociety::MaPit::call( 'areas', $area, - type => $c->cobrand->area_types, - ); + my $areas = mySociety::MaPit::call( 'areas', $area, %params ); if (keys %$areas == 1) { ($c->stash->{area}) = values %$areas; @@ -391,9 +393,11 @@ sub ward_check : Private { $parent_id = $c->stash->{area}->{id}; } - my $qw = mySociety::MaPit::call('area/children', [ $parent_id ], - type => $c->cobrand->area_types_children, - ); + my %params = ( type => $c->cobrand->area_types_children ); + $params{generation} = $c->config->{MAPIT_GENERATION} + if $c->config->{MAPIT_GENERATION}; + + my $qw = mySociety::MaPit::call('area/children', [ $parent_id ], %params); my %names = map { $c->cobrand->short_name({ name => $_ }) => 1 } @wards; my @areas; foreach my $area (sort { $a->{name} cmp $b->{name} } values %$qw) { |