aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-11-06 13:53:13 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-11-06 13:53:13 +0000
commitb50c652ec42afc1ce33a43925b098287065b3ff2 (patch)
tree806be90a2ff8af4c05db90efbb7bd75263ef6e17
parentdc442c07bae20d492423b4c7410ca0c0ab58d30c (diff)
Fix fetching of duplicate reports.
c9998984 altered nearby.json to use on_map rather than around_map, to prevent needless text appearing, but did not take account of the fact that it expects Problem objects, not Nearby objects.
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index ac52b217c..b1cc5885a 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -526,9 +526,10 @@ sub nearby_json : Private {
my $nearby = $c->model('DB::Nearby')->nearby(
$c, $dist, [ $p->id ], 5, $p->latitude, $p->longitude, [ $p->category ], undef
);
+ # Want to treat these as if they were on map
+ $nearby = [ map { $_->problem } @$nearby ];
my @pins = map {
- my $p = $_->problem;
- $p = $p->pin_data($c, 'around');
+ my $p = $_->pin_data($c, 'around');
[ $p->{latitude}, $p->{longitude}, $p->{colour},
$p->{id}, $p->{title}, 'small', JSON->false
]