From b50c652ec42afc1ce33a43925b098287065b3ff2 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Mon, 6 Nov 2017 13:53:13 +0000 Subject: 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. --- perllib/FixMyStreet/App/Controller/Report.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'perllib/FixMyStreet/App/Controller/Report.pm') 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 ] -- cgit v1.2.3