Skip to content

Commit

Permalink
Fix questionnaire time check in CSV export.
Browse files Browse the repository at this point in the history
Make sure returned in date order, and check correct value.
  • Loading branch information
dracos committed Sep 16, 2024
1 parent edbcac2 commit 86d8b42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions perllib/FixMyStreet/Script/CSVExport.pm
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ EOF
DECLARE csr CURSOR WITH HOLD FOR $sql_with SELECT $sql_select FROM "problem" "me" $sql_join
WHERE regexp_split_to_array("me"."bodies_str", ',') && ARRAY['$body_id']
$where_states
ORDER BY "me"."confirmed", "me"."id", "comments"."confirmed", "comments"."id";
ORDER BY "me"."confirmed", "me"."id", "comments"."confirmed", "comments"."id", "questionnaire"."whenanswered", "questionnaire"."id";
EOF
}

Expand Down Expand Up @@ -331,7 +331,7 @@ sub process_questionnaire {
my ($hashref, $obj) = @_;
my $new_state = $obj->{questionnaire_new_state} || '';
if ($fixed_states->{$new_state}) {
if (!$hashref->{fixed} || $obj->{comment_confirmed} lt $hashref->{fixed}) {
if (!$hashref->{fixed} || $obj->{questionnaire_whenanswered} lt $hashref->{fixed}) {
$hashref->{fixed} = $obj->{questionnaire_whenanswered};
}
}
Expand Down

0 comments on commit 86d8b42

Please sign in to comment.