aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-04-20 16:04:57 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-04-20 16:04:57 +0100
commit64fcf9db855a8058ff5a3088c59f1a9cb5e0bb4c (patch)
treef0ce42db66765e7140a4148210924cc9c9068169
parentfe91883bcc7d8023c0f6b40243afb9b149e1b719 (diff)
If no mapit is defined, just return a default area always (for #182).
-rw-r--r--perllib/FixMyStreet/App/Controller/Council.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Council.pm b/perllib/FixMyStreet/App/Controller/Council.pm
index c4819765a..b488346f8 100644
--- a/perllib/FixMyStreet/App/Controller/Council.pm
+++ b/perllib/FixMyStreet/App/Controller/Council.pm
@@ -37,6 +37,16 @@ there are no councils then return false.
sub load_and_check_councils : Private {
my ( $self, $c ) = @_;
+
+ # If no mapit is set up, let it through wherever
+ unless ($c->config->{MAPIT_URL}) {
+ my $area = { "name" => "Default Area", "type" => "ZZZ", "id" => 0 };
+ $c->stash->{all_areas} = { 0 => $area };
+ $c->stash->{all_councils} = { 0 => $area };
+ $c->stash->{all_council_names} = [ 'Default Area' ];
+ return 1;
+ }
+
my $latitude = $c->stash->{latitude};
my $longitude = $c->stash->{longitude};