diff options
author | Marius Halden <marius.h@lden.org> | 2019-10-30 19:28:55 +0100 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2019-10-30 19:28:55 +0100 |
commit | 377bd96aab7cad3434185c30eb908c9da447fe40 (patch) | |
tree | 7ec5527e205d5b62caaa862a7de8cd25199c8bf0 /perllib/FixMyStreet/Script/Alerts.pm | |
parent | 56f61b1441070aa0b9ddcfc74aca46c20313609f (diff) | |
parent | 92b253904062edd533e55c22824de6fd01e2f7c1 (diff) |
Merge tag 'v2.6' into fiksgatami-dev
Diffstat (limited to 'perllib/FixMyStreet/Script/Alerts.pm')
-rw-r--r-- | perllib/FixMyStreet/Script/Alerts.pm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/Script/Alerts.pm b/perllib/FixMyStreet/Script/Alerts.pm index 4b5641f9e..55f4b3db5 100644 --- a/perllib/FixMyStreet/Script/Alerts.pm +++ b/perllib/FixMyStreet/Script/Alerts.pm @@ -8,7 +8,7 @@ use IO::String; use FixMyStreet::Gaze; use mySociety::Locale; -use mySociety::MaPit; +use FixMyStreet::MapIt; use RABX; use FixMyStreet::Cobrand; @@ -185,12 +185,15 @@ sub send() { # Get a report object for its photo and static map $data{report} = $schema->resultset('Problem')->find({ id => $row->{id} }); } - if ($ref eq 'area_problems' || $ref eq 'council_problems' || $ref eq 'ward_problems') { - my $va_info = mySociety::MaPit::call('area', $row->{alert_parameter}); + if ($ref eq 'area_problems') { + my $va_info = FixMyStreet::MapIt::call('area', $row->{alert_parameter}); $data{area_name} = $va_info->{name}; + } elsif ($ref eq 'council_problems' || $ref eq 'ward_problems') { + my $body = FixMyStreet::DB->resultset('Body')->find({ id => $row->{alert_parameter} }); + $data{area_name} = $body->name; } if ($ref eq 'ward_problems') { - my $va_info = mySociety::MaPit::call('area', $row->{alert_parameter2}); + my $va_info = FixMyStreet::MapIt::call('area', $row->{alert_parameter2}); $data{ward_name} = $va_info->{name}; } } |