aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Dashboard.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-05-07 12:44:23 +0100
committerMatthew Somerville <matthew@mysociety.org>2020-05-07 14:40:17 +0100
commit5ce552af2b66613272dc9cfe2d46532e057f44f7 (patch)
tree660f00556af91fecbd64386b1c23c6ca54ca20f3 /perllib/FixMyStreet/App/Controller/Dashboard.pm
parentcfabb3cfd4474c1c812ed325a068d56bafc43a08 (diff)
Fix dashboard report CSV export.
The change to join in e16054150 did not include a collapse that the previous prefetch was doing, so multiple rows per result were being returned.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Dashboard.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Dashboard.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm
index e5a526efc..833d6d6b2 100644
--- a/perllib/FixMyStreet/App/Controller/Dashboard.pm
+++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm
@@ -349,14 +349,15 @@ sub export_as_csv : Private {
my $groups = $c->cobrand->enable_category_groups ? 1 : 0;
my $join = ['comments'];
- my $columns = ['comments.problem_state', 'comments.state', 'comments.confirmed', 'comments.mark_fixed'];
+ my $columns = ['comments.id', 'comments.problem_state', 'comments.state', 'comments.confirmed', 'comments.mark_fixed'];
if ($groups) {
push @$join, 'contact';
- push @$columns, 'contact.extra';
+ push @$columns, 'contact.id', 'contact.extra';
}
my $csv = $c->stash->{csv} = {
objects => $c->stash->{objects_rs}->search_rs({}, {
join => $join,
+ collapse => 1,
'+columns' => $columns,
order_by => ['me.confirmed', 'me.id'],
cursor_page_size => 1000,