Skip to content

Commit

Permalink
[Northumberland] Add comment when extra details updated
Browse files Browse the repository at this point in the history
  • Loading branch information
nephila-nacrea committed Sep 9, 2024
1 parent f3ba4a0 commit 224a88b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion perllib/FixMyStreet/App/Controller/Report.pm
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ sub inspect : Private {
if ($permissions->{report_inspect}) {
$problem->set_extra_metadata( traffic_information => $c->get_param('traffic_information') );

my $old_detailed_information
= $problem->get_extra_metadata('detailed_information');
if ( my $info = $c->get_param('detailed_information') ) {
$problem->set_extra_metadata( detailed_information => $info );
if ($c->cobrand->max_detailed_info_length &&
Expand All @@ -472,6 +474,21 @@ sub inspect : Private {
$c->cobrand->max_detailed_info_length
);
}
} elsif ( $c->get_param('detailed_information') eq '' ) {
$problem->unset_extra_metadata('detailed_information');
}

my $handler
= $c->cobrand->call_hook(
get_body_handler_for_problem => $problem
) || $c->cobrand;
my $record_extra
= $handler->call_hook('record_update_extra_fields');
if ( $record_extra->{detailed_information}
&& $problem->get_extra_metadata('detailed_information') ne
$old_detailed_information )
{
$update_params{extra}{detailed_information} = 1;

Check warning on line 491 in perllib/FixMyStreet/App/Controller/Report.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/App/Controller/Report.pm#L491

Added line #L491 was not covered by tests
}

if ( $c->get_param('include_update') or $c->get_param('raise_defect') ) {
Expand Down Expand Up @@ -521,7 +538,7 @@ sub inspect : Private {
# If the state has been changed to action scheduled and they've said
# they want to raise a defect, consider the report to be inspected.
if ($problem->state eq 'action scheduled' && $c->get_param('raise_defect') && !$problem->get_extra_metadata('inspected')) {
$update_params{extra} = { 'defect_raised' => 1 };
$update_params{extra}{defect_raised} = 1;
$problem->set_extra_metadata( inspected => 1 );
$c->forward( '/admin/log_edit', [ $problem->id, 'problem', 'inspected' ] );
}
Expand Down

0 comments on commit 224a88b

Please sign in to comment.