diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report.pm | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm index f732b94f1..a15ee993f 100644 --- a/perllib/FixMyStreet/App/Controller/Report.pm +++ b/perllib/FixMyStreet/App/Controller/Report.pm @@ -60,9 +60,9 @@ sub load_problem_or_display_error : Private { my ( $self, $c, $id ) = @_; # try to load a report if the id is a number - my $problem # - = $id =~ m{\D} # is id non-numeric? - ? undef # ...don't even search + my $problem + = ( !$id || $id =~ m{\D} ) # is id non-numeric? + ? undef # ...don't even search : $c->cobrand->problems->find( { id => $id } ); # check that the problem is suitable to show. @@ -110,23 +110,8 @@ sub format_problem_for_display : Private { $c->stash->{report_name} = $c->req->param('name'); - if ( $c->req->param('submit_update') ) { - # we may have munged these previously in /report/update - # so only set if they're not already in the stash - $c->stash->{form_name} ||= $c->req->param('name'); - $c->stash->{update_text} ||= $c->req->param('update'); - $c->stash->{email} ||= $c->req->param('rznvy'); - $c->stash->{fixed} ||= $c->req->param('fixed') ? ' checked' : ''; - $c->stash->{add_alert_checked} ||= - ( $c->req->param('add_alert') ? ' checked' : '' ); - } - else { - if ( $c->user ) { - $c->stash->{form_name} = $c->user->name; - $c->stash->{email} = $c->user->email; - $c->stash->{may_show_name} = ' checked' if $c->user->name; - } - $c->stash->{add_alert_checked} = ' checked'; + unless ( $c->req->param('submit_update') ) { + $c->stash->{add_alert} = 1; } $c->forward('generate_map_tags'); |