diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-05-07 10:13:15 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-05-07 10:13:15 +0100 |
commit | ab0d1dc84b1ed7a1c572e986eda3a4bdc5157d77 (patch) | |
tree | 92f7637a4350d8211d0620a0420ba44724bfefad /perllib/FixMyStreet/App/Controller/Report.pm | |
parent | 2773c60226b9370fe8ee00f7b205b571bb87c3b5 (diff) | |
parent | 730d25ae7218d731590b322d4f419a7df6d4e4fb (diff) |
Merge branch '2991-updates-on-categories'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm index 72f96013a..058edebd8 100644 --- a/perllib/FixMyStreet/App/Controller/Report.pm +++ b/perllib/FixMyStreet/App/Controller/Report.pm @@ -133,11 +133,13 @@ sub support :Chained('id') :Args(0) { sub load_problem_or_display_error : Private { my ( $self, $c, $id ) = @_; + my $attrs = { prefetch => 'contact' }; + # try to load a report if the id is a number my $problem = ( !$id || $id =~ m{\D} ) # is id non-numeric? ? undef # ...don't even search - : $c->cobrand->problems->find( { id => $id } ) + : $c->cobrand->problems->find( { id => $id }, $attrs ) or $c->detach( '/page_error_404_not_found', [ _('Unknown problem ID') ] ); # check that the problem is suitable to show. |