aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-02-18 14:05:11 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-02-28 09:21:42 +0000
commit9b218a05b1b06ef4dabd531cb6aad0e92cbf527f (patch)
tree40f732555c5f2b6fe7888033bbdbaa4f62e1c6af
parent656def632b1d6ea88d777712da90251d0f9d9e76 (diff)
Do not assign bodyless reports to area IDs.
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm18
1 files changed, 5 insertions, 13 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index 4c28563de..85848a181 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -626,19 +626,11 @@ sub load_and_group_problems : Private {
add_row( $c, $problem, 0, \%problems, \@pins );
next;
}
- if ( !$problem->bodies_str ) {
- # Problem was not sent to any body, add to all possible areas XXX
- my $a = $problem->areas; # Store, as otherwise is looked up every iteration.
- while ($a =~ /,(\d+)(?=,)/g) {
- add_row( $c, $problem, $1, \%problems, \@pins );
- }
- } else {
- # Add to bodies it was sent to
- my $bodies = $problem->bodies_str_ids;
- foreach ( @$bodies ) {
- next if $_ != $body->id;
- add_row( $c, $problem, $_, \%problems, \@pins );
- }
+ # Add to bodies it was sent to
+ my $bodies = $problem->bodies_str_ids;
+ foreach ( @$bodies ) {
+ next if $_ != $body->id;
+ add_row( $c, $problem, $_, \%problems, \@pins );
}
}