From 3e9277ed0e81b5d09656bff0aa5dacd87da1e55e Mon Sep 17 00:00:00 2001 From: Martin Wright Date: Wed, 9 Oct 2019 14:02:12 +0100 Subject: [Hackney] Initial cobrand design & privacy policy amendment Co-Authored-By: Struan Donald For https://github.com/mysociety/fixmystreet-commercial/issues/1808 --- perllib/FixMyStreet/Cobrand/Hackney.pm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 perllib/FixMyStreet/Cobrand/Hackney.pm (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm new file mode 100644 index 000000000..e726154b0 --- /dev/null +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -0,0 +1,24 @@ +package FixMyStreet::Cobrand::Hackney; +use parent 'FixMyStreet::Cobrand::Whitelabel'; + +use strict; +use warnings; + +sub council_area_id { return 2508; } +sub council_area { return 'Hackney'; } +sub council_name { return 'Hackney Council'; } +sub council_url { return 'hackney'; } +sub send_questionnaires { 0 } + +sub disambiguate_location { + my $self = shift; + my $string = shift; + + return { + %{ $self->SUPER::disambiguate_location() }, + centre => '51.552267,-0.063316', + bounds => [ 51.519814, -0.104511, 51.577784, -0.016527 ], + }; +} + +1; -- cgit v1.2.3 From 49805dd6a3ed38f06e355ad3603eb411d9e6dd15 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Fri, 28 Feb 2020 14:52:46 +0000 Subject: [Hackney] set extra open311 parameters --- perllib/FixMyStreet/Cobrand/Hackney.pm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm index e726154b0..a888224d7 100644 --- a/perllib/FixMyStreet/Cobrand/Hackney.pm +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -21,4 +21,26 @@ sub disambiguate_location { }; } +sub open311_config { + my ($self, $row, $h, $params) = @_; + + $params->{multi_photos} = 1; +} + +sub open311_extra_data { + my ($self, $row, $h, $extra) = @_; + + my $open311_only = [ + { name => 'report_url', + value => $h->{url} }, + { name => 'title', + value => $row->title }, + { name => 'description', + value => $row->detail }, + { name => 'category', + value => $row->category }, + ]; + + return $open311_only; +} 1; -- cgit v1.2.3 From 4237159458ce724c42c3952ec48a111f71050beb Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Wed, 11 Mar 2020 15:26:47 +0000 Subject: [Hackney] Use OpenStreetMap base map Also bumps up default zoom level a couple of notches For https://github.com/mysociety/fixmystreet-commercial/issues/1760 --- perllib/FixMyStreet/Cobrand/Hackney.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm index a888224d7..6af147a16 100644 --- a/perllib/FixMyStreet/Cobrand/Hackney.pm +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -43,4 +43,9 @@ sub open311_extra_data { return $open311_only; } + +sub map_type { 'OSM' } + +sub default_map_zoom { 5 } + 1; -- cgit v1.2.3 From 002057bfedb00ff3cef14783d165a1c5fc3d0c56 Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Thu, 23 Apr 2020 15:13:08 +0100 Subject: [Hackney] Switch to OSM geocoder --- perllib/FixMyStreet/Cobrand/Hackney.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm index 6af147a16..eeca31186 100644 --- a/perllib/FixMyStreet/Cobrand/Hackney.pm +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -16,11 +16,16 @@ sub disambiguate_location { return { %{ $self->SUPER::disambiguate_location() }, + town => 'Hackney', centre => '51.552267,-0.063316', bounds => [ 51.519814, -0.104511, 51.577784, -0.016527 ], }; } +sub get_geocoder { + return 'OSM'; # default of Bing gives poor results, let's try overriding. +} + sub open311_config { my ($self, $row, $h, $params) = @_; -- cgit v1.2.3 From 761afd95fdc7cc98adb87c0ccfbb850e91dccc25 Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Thu, 7 May 2020 11:32:20 +0100 Subject: [Hackney] Add admin_user_domain --- perllib/FixMyStreet/Cobrand/Hackney.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm index eeca31186..deb408ab1 100644 --- a/perllib/FixMyStreet/Cobrand/Hackney.pm +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -53,4 +53,6 @@ sub map_type { 'OSM' } sub default_map_zoom { 5 } +sub admin_user_domain { 'hackney.gov.uk' } + 1; -- cgit v1.2.3 From 6a013ddcfeb590863e16989652a0393acceb6e29 Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Mon, 1 Jun 2020 16:12:57 +0100 Subject: [Hackney] Enable anonymous reporting --- perllib/FixMyStreet/Cobrand/Hackney.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm index deb408ab1..76cd3f1dd 100644 --- a/perllib/FixMyStreet/Cobrand/Hackney.pm +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -55,4 +55,12 @@ sub default_map_zoom { 5 } sub admin_user_domain { 'hackney.gov.uk' } +sub anonymous_account { + my $self = shift; + return { + email => $self->feature('anonymous_account') . '@' . $self->admin_user_domain, + name => 'Anonymous user', + }; +} + 1; -- cgit v1.2.3 From aa9d3cce479c7b28ba3f5f09cac0231111aeebf8 Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Mon, 8 Jun 2020 13:05:40 +0100 Subject: [Hackney] Extend open311_protect flag to entire contact, not just name/group --- perllib/FixMyStreet/Cobrand/Hackney.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm index 76cd3f1dd..f08cd0dd9 100644 --- a/perllib/FixMyStreet/Cobrand/Hackney.pm +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -63,4 +63,21 @@ sub anonymous_account { }; } +sub open311_skip_existing_contact { + my ($self, $contact) = @_; + + # For Hackney we want the 'protected' flag to prevent any changes to this + # contact at all. + return $contact->get_extra_metadata("open311_protect") ? 1 : 0; +} + +sub open311_filter_contacts_for_deletion { + my ($self, $contacts) = @_; + + # Don't delete open311 protected contacts when importing + return $contacts->search({ + extra => { -not_like => '%T15:open311_protect,I1:1%' }, + }); +} + 1; -- cgit v1.2.3 From 53b9f82cbb7fe81484b8bbf434f0b0acd925b454 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Mon, 11 May 2020 12:43:02 +0100 Subject: [Hackney] Special destination handling. --- perllib/FixMyStreet/Cobrand/Hackney.pm | 62 +++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm index f08cd0dd9..dbf070628 100644 --- a/perllib/FixMyStreet/Cobrand/Hackney.pm +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -3,6 +3,7 @@ use parent 'FixMyStreet::Cobrand::Whitelabel'; use strict; use warnings; +use mySociety::EmailUtil qw(is_valid_email); sub council_area_id { return 2508; } sub council_area { return 'Hackney'; } @@ -33,7 +34,7 @@ sub open311_config { } sub open311_extra_data { - my ($self, $row, $h, $extra) = @_; + my ($self, $row, $h, $extra, $contact) = @_; my $open311_only = [ { name => 'report_url', @@ -46,6 +47,13 @@ sub open311_extra_data { value => $row->category }, ]; + # Make sure contact 'email' set correctly for Open311 + if (my $sent_to = $row->get_extra_metadata('sent_to')) { + $row->unset_extra_metadata('sent_to'); + my $code = $sent_to->{$contact->email}; + $contact->email($code) if $code; + } + return $open311_only; } @@ -80,4 +88,56 @@ sub open311_filter_contacts_for_deletion { }); } +sub lookup_site_code_config { + my ($self, $type) = @_; + my $property_map = { + park => "greenspaces:hackney_park", + estate => "housing:lbh_estate", + }; + { + buffer => 3, # metres + url => "https://map.hackney.gov.uk/geoserver/wfs", + srsname => "urn:ogc:def:crs:EPSG::27700", + typename => $property_map->{$type}, + property => ( $type eq "park" ? "park_id" : "id" ), + accept_feature => sub { 1 }, + accept_types => { Polygon => 1 }, + outputformat => "json", + } +} + +sub get_body_sender { + my ( $self, $body, $problem ) = @_; + + my $contact = $body->contacts->search( { category => $problem->category } )->first; + + my $parts = join '\s*', qw(^ park : (.*?) ; estate : (.*?) ; other : (.*?) $); + my $regex = qr/$parts/i; + if (my ($park, $estate, $other) = $contact->email =~ $regex) { + my $to = $other; + if (my $park_id = $self->lookup_site_code($problem, 'park')) { + $to = $park; + } elsif (my $estate_id = $self->lookup_site_code($problem, 'estate')) { + $to = $estate; + } + $problem->set_extra_metadata(sent_to => { $contact->email => $to }); + if (is_valid_email($to)) { + return { method => 'Email', contact => $contact }; + } + } + return $self->SUPER::get_body_sender($body, $problem); +} + +# Translate email address to actual delivery address +sub munge_sendreport_params { + my ($self, $row, $h, $params) = @_; + + my $sent_to = $row->get_extra_metadata('sent_to') or return; + $row->unset_extra_metadata('sent_to'); + for my $recip (@{$params->{To}}) { + my ($email, $name) = @$recip; + $recip->[0] = $sent_to->{$email} if $sent_to->{$email}; + } +} + 1; -- cgit v1.2.3 From 41ed9db574ecb77504992f3836ced7f25fe1768d Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Wed, 13 May 2020 16:42:47 +0100 Subject: [Hackney] Enable OIDC social login --- perllib/FixMyStreet/Cobrand/Hackney.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm index dbf070628..b0c815d70 100644 --- a/perllib/FixMyStreet/Cobrand/Hackney.pm +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -63,6 +63,12 @@ sub default_map_zoom { 5 } sub admin_user_domain { 'hackney.gov.uk' } +sub social_auth_enabled { + my $self = shift; + + return $self->feature('oidc_login') ? 1 : 0; +} + sub anonymous_account { my $self = shift; return { -- cgit v1.2.3 From ecdd0473e28ffbc3b877cc90ee13208cb97f28ec Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Tue, 16 Jun 2020 19:47:03 +0100 Subject: [Hackney] Refine geocoder results display --- perllib/FixMyStreet/Cobrand/Hackney.pm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm index b0c815d70..038d9cff3 100644 --- a/perllib/FixMyStreet/Cobrand/Hackney.pm +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -27,6 +27,27 @@ sub get_geocoder { return 'OSM'; # default of Bing gives poor results, let's try overriding. } +sub geocoder_munge_query_params { + my ($self, $params) = @_; + + $params->{addressdetails} = 1; +} + +sub geocoder_munge_results { + my ($self, $result) = @_; + if (my $a = $result->{address}) { + if ($a->{road} && $a->{suburb} && $a->{postcode}) { + $result->{display_name} = "$a->{road}, $a->{suburb}, $a->{postcode}"; + return; + } + } + $result->{display_name} = '' unless $result->{display_name} =~ /Hackney/; + $result->{display_name} =~ s/, United Kingdom$//; + $result->{display_name} =~ s/, London, Greater London, England//; + $result->{display_name} =~ s/, London Borough of Hackney//; +} + + sub open311_config { my ($self, $row, $h, $params) = @_; -- cgit v1.2.3 From 86ba23a6fdc0a9857f7729366d25a0dc124d9c97 Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Wed, 17 Jun 2020 12:18:36 +0100 Subject: [Hackney] Query WFS server differently when finding park/estate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For some reason the BBOX query would return results that weren’t actually intersecting the BBOX causing false positives and misdirected reports. This change uses the Intersects query instead which is more accurate. --- perllib/FixMyStreet/Cobrand/Hackney.pm | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm index 038d9cff3..ed29471b2 100644 --- a/perllib/FixMyStreet/Cobrand/Hackney.pm +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -115,22 +115,27 @@ sub open311_filter_contacts_for_deletion { }); } -sub lookup_site_code_config { - my ($self, $type) = @_; - my $property_map = { +sub problem_is_within_area_type { + my ($self, $problem, $type) = @_; + my $layer_map = { park => "greenspaces:hackney_park", estate => "housing:lbh_estate", }; - { - buffer => 3, # metres + my $layer = $layer_map->{$type}; + return unless $layer; + + my ($x, $y) = $problem->local_coords; + + my $cfg = { url => "https://map.hackney.gov.uk/geoserver/wfs", srsname => "urn:ogc:def:crs:EPSG::27700", - typename => $property_map->{$type}, - property => ( $type eq "park" ? "park_id" : "id" ), - accept_feature => sub { 1 }, - accept_types => { Polygon => 1 }, + typename => $layer, outputformat => "json", - } + filter => "geom$x,$y", + }; + + my $features = $self->_fetch_features($cfg, $x, $y) || []; + return scalar @$features ? 1 : 0; } sub get_body_sender { @@ -142,9 +147,9 @@ sub get_body_sender { my $regex = qr/$parts/i; if (my ($park, $estate, $other) = $contact->email =~ $regex) { my $to = $other; - if (my $park_id = $self->lookup_site_code($problem, 'park')) { + if ($self->problem_is_within_area_type($problem, 'park')) { $to = $park; - } elsif (my $estate_id = $self->lookup_site_code($problem, 'estate')) { + } elsif ($self->problem_is_within_area_type($problem, 'estate')) { $to = $estate; } $problem->set_extra_metadata(sent_to => { $contact->email => $to }); -- cgit v1.2.3 From e96deac6ee76f792bc117ccf8096024f3b817c6c Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Wed, 17 Jun 2020 13:44:07 +0100 Subject: [Hackney] Add geocoder override for Teale Street --- perllib/FixMyStreet/Cobrand/Hackney.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm index ed29471b2..c3af134a9 100644 --- a/perllib/FixMyStreet/Cobrand/Hackney.pm +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -15,9 +15,17 @@ sub disambiguate_location { my $self = shift; my $string = shift; + my $town = 'Hackney'; + + # Teale Street is on the boundary with Tower Hamlets and + # shows the 'please use fixmystreet.com' message, but Hackney + # do provide services on that road. + ($string, $town) = ('E2 9AA', '') if $string =~ /^teale\s+st/i; + return { %{ $self->SUPER::disambiguate_location() }, - town => 'Hackney', + string => $string, + town => $town, centre => '51.552267,-0.063316', bounds => [ 51.519814, -0.104511, 51.577784, -0.016527 ], }; -- cgit v1.2.3 From f4b5a6263b1529003a42787b404952ab28aefeba Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Thu, 2 Jul 2020 17:13:50 +0100 Subject: [Hackney] Use cobrand feature config for email envelope domain --- perllib/FixMyStreet/Cobrand/Hackney.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm index c3af134a9..234573e3e 100644 --- a/perllib/FixMyStreet/Cobrand/Hackney.pm +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -31,6 +31,10 @@ sub disambiguate_location { }; } +sub do_not_reply_email { shift->feature('do_not_reply_email') } + +sub verp_email_domain { shift->feature('verp_email_domain') } + sub get_geocoder { return 'OSM'; # default of Bing gives poor results, let's try overriding. } -- cgit v1.2.3 From d9cf470f321dc334391a35405a527521a3b605d5 Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Mon, 24 Aug 2020 16:34:59 +0100 Subject: [Hackney] Allow editing & addition of contacts with special destination addresses This adds a cobrand hook to validate the email address provided when editing a contact in the admin. --- perllib/FixMyStreet/Cobrand/Hackney.pm | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm index 234573e3e..459cf3e4d 100644 --- a/perllib/FixMyStreet/Cobrand/Hackney.pm +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -3,7 +3,7 @@ use parent 'FixMyStreet::Cobrand::Whitelabel'; use strict; use warnings; -use mySociety::EmailUtil qw(is_valid_email); +use mySociety::EmailUtil qw(is_valid_email is_valid_email_list); sub council_area_id { return 2508; } sub council_area { return 'Hackney'; } @@ -155,9 +155,7 @@ sub get_body_sender { my $contact = $body->contacts->search( { category => $problem->category } )->first; - my $parts = join '\s*', qw(^ park : (.*?) ; estate : (.*?) ; other : (.*?) $); - my $regex = qr/$parts/i; - if (my ($park, $estate, $other) = $contact->email =~ $regex) { + if (my ($park, $estate, $other) = $self->_split_emails($contact->email)) { my $to = $other; if ($self->problem_is_within_area_type($problem, 'park')) { $to = $park; @@ -184,4 +182,24 @@ sub munge_sendreport_params { } } +sub _split_emails { + my ($self, $email) = @_; + + my $parts = join '\s*', qw(^ park : (.*?) ; estate : (.*?) ; other : (.*?) $); + my $regex = qr/$parts/i; + + my ($park, $estate, $other) = $email =~ $regex; + return ($park, $estate, $other); +} + +sub validate_contact_email { + my ( $self, $email ) = @_; + + return 1 if is_valid_email_list($email); + + my @emails = grep { $_ } $self->_split_emails($email); + return unless @emails; + return 1 if is_valid_email_list(join(",", @emails)); +} + 1; -- cgit v1.2.3 From 470c24e00b12ac82fa7d34534cb9c1bd6cda53ff Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Tue, 25 Aug 2020 11:12:28 +0100 Subject: [Hackney] Increase default zoom level --- perllib/FixMyStreet/Cobrand/Hackney.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm index 459cf3e4d..5168805c5 100644 --- a/perllib/FixMyStreet/Cobrand/Hackney.pm +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -92,7 +92,7 @@ sub open311_extra_data { sub map_type { 'OSM' } -sub default_map_zoom { 5 } +sub default_map_zoom { 6 } sub admin_user_domain { 'hackney.gov.uk' } -- cgit v1.2.3 From af317bf3ade4694ede7a4d8d163929b8576c7bdd Mon Sep 17 00:00:00 2001 From: M Somerville Date: Fri, 28 Aug 2020 17:56:04 +0100 Subject: [Hackney] Do not match non-special destination addresses. --- perllib/FixMyStreet/Cobrand/Hackney.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm index 5168805c5..4c035f926 100644 --- a/perllib/FixMyStreet/Cobrand/Hackney.pm +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -188,8 +188,10 @@ sub _split_emails { my $parts = join '\s*', qw(^ park : (.*?) ; estate : (.*?) ; other : (.*?) $); my $regex = qr/$parts/i; - my ($park, $estate, $other) = $email =~ $regex; - return ($park, $estate, $other); + if (my ($park, $estate, $other) = $email =~ $regex) { + return ($park, $estate, $other); + } + return (); } sub validate_contact_email { -- cgit v1.2.3 From 541bb773ba95e147ababdf015ea83356aeda54b2 Mon Sep 17 00:00:00 2001 From: M Somerville Date: Tue, 6 Oct 2020 09:57:18 +0100 Subject: [UK] Prevent duplicate extra fields when blank. If a report had an existing, but empty, extra field that was looked up on the server when being sent by Open311, the looked up information would be added as an additional extra field, rather than replacing the blank one. --- perllib/FixMyStreet/Cobrand/Hackney.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perllib/FixMyStreet/Cobrand/Hackney.pm') diff --git a/perllib/FixMyStreet/Cobrand/Hackney.pm b/perllib/FixMyStreet/Cobrand/Hackney.pm index 4c035f926..b8f92f1ea 100644 --- a/perllib/FixMyStreet/Cobrand/Hackney.pm +++ b/perllib/FixMyStreet/Cobrand/Hackney.pm @@ -67,7 +67,7 @@ sub open311_config { } sub open311_extra_data { - my ($self, $row, $h, $extra, $contact) = @_; + my ($self, $row, $h, $contact) = @_; my $open311_only = [ { name => 'report_url', -- cgit v1.2.3