diff options
author | Struan Donald <struan@exo.org.uk> | 2012-05-22 16:19:43 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-05-22 16:19:43 +0100 |
commit | 6ab27d6be43abfbfdbdb95b03b249d04a47a912f (patch) | |
tree | 0cf29cf721ffc6c9bbf2ae8da856ccbce4fcdac1 /perllib/Open311.pm | |
parent | d7b74385feb281ff203ae77fe6560483aae7e94a (diff) |
If from an existing report page you click 'Nearby problems' > skip map
then you end up with used_map=f and nothign in postcode so we should
not attempt to send the postcode over open311 as it won't be there
Diffstat (limited to 'perllib/Open311.pm')
-rw-r--r-- | perllib/Open311.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/perllib/Open311.pm b/perllib/Open311.pm index b380409cf..997f04b53 100644 --- a/perllib/Open311.pm +++ b/perllib/Open311.pm @@ -102,7 +102,11 @@ sub _populate_service_request_params { last_name => $lastname || '', }; - if ( $problem->used_map || $self->always_send_latlong ) { + # if you click nearby reports > skip map then it's possible + # to end up with used_map = f and nothing in postcode + if ( $problem->used_map || $self->always_send_latlong + || ( !$problem->used_map && !$problem->postcode ) ) + { $params->{lat} = $problem->latitude; $params->{long} = $problem->longitude; } else { |