aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/New.pm
diff options
context:
space:
mode:
authorDave Whiteland <dave@mysociety.org>2012-07-11 19:03:38 +0100
committerDave Whiteland <dave@mysociety.org>2012-07-11 23:57:54 +0100
commit55751b48ca0cd977bf1d58ed600eff22bf5e8e81 (patch)
treefbb582003641d5eec5d2d978741a5f0248f2d3fe /perllib/FixMyStreet/App/Controller/Report/New.pm
parente76a83d5ae9e34f227921847dde45518f6073896 (diff)
added Message Manager ID (mm_msg_id) column and used it
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 57175269c..011e9e4b6 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -801,9 +801,6 @@ sub process_report : Private {
# set these straight from the params
$report->category( _ $params{category} ) if $params{category};
- # if there is a Message Manager message ID, save it
- $report->mm_msg_id( $params{mm_msg_id} ) if $params{mm_msg_id}=~/^\d+$/;
-
my $areas = $c->stash->{all_areas};
$report->areas( ',' . join( ',', sort keys %$areas ) . ',' );
@@ -1004,6 +1001,12 @@ sub save_user_and_report : Private {
# Set unknown to DB unknown
$report->council( undef ) if $report->council eq '-1';
+ # if there is a Message Manager message ID, pass it back to the client view
+ if ($c->req->param('mm_msg_id')=~/^\d+$/) {
+ $c->stash->{mm_msg_id} = $c->req->param('mm_msg_id');
+ $report->mm_msg_id( $c->req->param('mm_msg_id') );
+ }
+
# save the report;
$report->in_storage ? $report->update : $report->insert();