diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-04-16 18:08:43 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-04-23 15:39:50 +0100 |
commit | 8ca1681a0c9e3627b1b4c6ed8599e9b4c6d276a1 (patch) | |
tree | 551dd62b1511b47a45c87260ee64bd3ec164f23c /perllib/FixMyStreet/App/Controller/Report/New.pm | |
parent | 86eae502d494090430f3076f25331df797b9172b (diff) |
Add new report hooks for cobrand report munging.
One to alter the category after initially set, one to change
any details of the report before saving to the database.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 7b4f1abad..7468b0041 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -918,6 +918,7 @@ sub process_report : Private { # set these straight from the params $report->category( _ $params{category} ) if $params{category}; + $c->cobrand->call_hook(report_new_munge_category => $report); $report->subcategory( $params{subcategory} ); my $areas = $c->stash->{all_areas_mapit}; @@ -1351,6 +1352,8 @@ sub save_user_and_report : Private { $c->log->info($report->user->id . ' exists, but is not logged in for this report'); } + $c->cobrand->call_hook(report_new_munge_before_insert => $report); + $report->update_or_insert; # tidy up |