diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report.pm | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm index 669d3c41f..a1f357644 100644 --- a/perllib/FixMyStreet/App/Controller/Report.pm +++ b/perllib/FixMyStreet/App/Controller/Report.pm @@ -375,12 +375,6 @@ sub inspect : Private { } } - if ( $c->get_param('defect_type') ) { - $problem->defect_type($problem->defect_types->find($c->get_param('defect_type'))); - } else { - $problem->defect_type(undef); - } - if ( $c->get_param('include_update') ) { $update_text = Utils::cleanup_text( $c->get_param('public_update'), { allow_multiline => 1 } ); if (!$update_text) { @@ -461,7 +455,8 @@ sub inspect : Private { $c->forward('/report/new/set_report_extras', [ \@contacts, $param_prefix ]); } - # Updating priority must come after category, in case category has changed (and so might have priorities) + # Updating priority/defect type must come after category, in case + # category has changed (and so might have priorities/defect types) if ($permissions->{report_inspect} || $permissions->{report_edit_priority}) { if ($c->get_param('priority')) { $problem->response_priority( $problem->response_priorities->find({ id => $c->get_param('priority') }) ); @@ -470,6 +465,14 @@ sub inspect : Private { } } + if ($permissions->{report_inspect}) { + if ( $c->get_param('defect_type') ) { + $problem->defect_type($problem->defect_types->find($c->get_param('defect_type'))); + } else { + $problem->defect_type(undef); + } + } + if ($valid) { if ( $reputation_change != 0 ) { $problem->user->update_reputation($reputation_change); |