aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin/Bodies.pm8
-rw-r--r--perllib/FixMyStreet/App/Controller/Open311.pm5
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm16
3 files changed, 20 insertions, 9 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
index 56bc554e9..1f8840bcb 100644
--- a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm
@@ -187,10 +187,14 @@ sub body_form_dropdowns : Private {
my $areas;
my $whitelist = $c->config->{MAPIT_ID_WHITELIST};
+ my %params;
+ $params{generation} = $c->config->{MAPIT_GENERATION}
+ if $c->config->{MAPIT_GENERATION};
+
if ( $whitelist && ref $whitelist eq 'ARRAY' && @$whitelist ) {
- $areas = mySociety::MaPit::call('areas', $whitelist);
+ $areas = mySociety::MaPit::call('areas', $whitelist, %params);
} else {
- $areas = mySociety::MaPit::call('areas', $c->cobrand->area_types);
+ $areas = mySociety::MaPit::call('areas', $c->cobrand->area_types, %params);
}
# Some cobrands may want to add extra areas at runtime beyond those
diff --git a/perllib/FixMyStreet/App/Controller/Open311.pm b/perllib/FixMyStreet/App/Controller/Open311.pm
index 83b9b8202..5d7ec63d6 100644
--- a/perllib/FixMyStreet/App/Controller/Open311.pm
+++ b/perllib/FixMyStreet/App/Controller/Open311.pm
@@ -164,9 +164,12 @@ sub get_services : Private {
if ($lat || $lon) {
my $area_types = $c->cobrand->area_types;
+ my %params = ( type => $area_types );
+ $params{generation} = $c->config->{MAPIT_GENERATION}
+ if $c->config->{MAPIT_GENERATION};
my $all_areas = mySociety::MaPit::call('point',
"4326/$lon,$lat",
- type => $area_types);
+ %params);
$categories = $categories->search( {
'body_areas.area_id' => [ keys %$all_areas ],
}, { join => { 'body' => 'body_areas' } } );
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) {