diff options
author | Chris Mytton <chrism@mysociety.org> | 2020-04-08 14:39:19 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2020-08-06 10:59:14 +0100 |
commit | ed0002b0d76560cc3d5b1e62f8395bbfae74403c (patch) | |
tree | 32a1ee32d0d447ba01207e66d3aab0b09a1f525d /perllib/FixMyStreet/App/Controller/Report.pm | |
parent | 30de263a85621fcad51991661475cdc422730c12 (diff) |
Add photo upload field to inspector form
This adds the code for photo uploads from the regular update form to the
inspector form, and adds details to the documentation.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm index dd7abc563..991064f55 100644 --- a/perllib/FixMyStreet/App/Controller/Report.pm +++ b/perllib/FixMyStreet/App/Controller/Report.pm @@ -554,6 +554,12 @@ sub inspect : Private { $c->cobrand->call_hook(report_inspect_update_extra => $problem); + $c->forward('/photo/process_photo'); + if ( my $photo_error = delete $c->stash->{photo_error} ) { + $valid = 0; + push @{ $c->stash->{errors} }, $photo_error; + } + if ($valid) { $problem->lastupdate( \'current_timestamp' ); $problem->update; @@ -574,6 +580,7 @@ sub inspect : Private { created => $timestamp, confirmed => $timestamp, user => $c->user->obj, + photo => $c->stash->{upload_fileid} || undef, %update_params, } ); } |