aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Controller/Contact.pm3
-rw-r--r--perllib/FixMyStreet/Cobrand/Hounslow.pm8
-rw-r--r--perllib/FixMyStreet/Map/UKCouncilWMTS.pm2
3 files changed, 9 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Contact.pm b/perllib/FixMyStreet/App/Controller/Contact.pm
index c8cd14907..06566a8ab 100644
--- a/perllib/FixMyStreet/App/Controller/Contact.pm
+++ b/perllib/FixMyStreet/App/Controller/Contact.pm
@@ -33,7 +33,6 @@ sub begin : Private {
my ($self, $c) = @_;
$c->forward('/begin');
$c->forward('setup_request');
- $c->forward('determine_contact_type');
}
=head2 index
@@ -44,6 +43,7 @@ Display contact us page
sub index : Path : Args(0) {
my ( $self, $c ) = @_;
+ $c->forward('determine_contact_type');
}
=head2 submit
@@ -55,6 +55,7 @@ Handle contact us form submission
sub submit : Path('submit') : Args(0) {
my ( $self, $c ) = @_;
+ $c->forward('determine_contact_type');
$c->res->redirect( '/contact' ) and return unless $c->req->method eq 'POST';
$c->go('index') unless $c->forward('validate');
diff --git a/perllib/FixMyStreet/Cobrand/Hounslow.pm b/perllib/FixMyStreet/Cobrand/Hounslow.pm
index 2987c0ae3..2146f2b67 100644
--- a/perllib/FixMyStreet/Cobrand/Hounslow.pm
+++ b/perllib/FixMyStreet/Cobrand/Hounslow.pm
@@ -76,12 +76,14 @@ sub all_reports_single_body { { name => "Hounslow Borough Council" } }
sub open311_post_send {
my ($self, $row, $h) = @_;
- # Check Open311 was successful
- return unless $row->external_id;
+ # Stop the email being sent for each Open311 failure; only the once.
+ return if $row->get_extra_metadata('hounslow_email_sent');
my $e = join( '@', 'enquiries', $self->council_url . 'highways.org' );
my $sender = FixMyStreet::SendReport::Email->new( to => [ [ $e, 'Hounslow Highways' ] ] );
- $sender->send($row, $h);
+ if (!$sender->send($row, $h)) {
+ $row->set_extra_metadata('hounslow_email_sent', 1);
+ }
}
sub open311_config {
diff --git a/perllib/FixMyStreet/Map/UKCouncilWMTS.pm b/perllib/FixMyStreet/Map/UKCouncilWMTS.pm
index da0720f06..aba6d3840 100644
--- a/perllib/FixMyStreet/Map/UKCouncilWMTS.pm
+++ b/perllib/FixMyStreet/Map/UKCouncilWMTS.pm
@@ -36,6 +36,8 @@ sub tile_parameters {
# Reproject a WGS84 lat/lon into BNG easting/northing
sub reproject_from_latlon($$$) {
my ($self, $lat, $lon) = @_;
+ # do not try to reproject if we have no co-ordindates as convert breaks
+ return (0.0, 0.0) if $lat == 0 && $lon == 0;
my ($x, $y) = Utils::convert_latlon_to_en($lat, $lon);
return ($x, $y);
}