aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-06-23 14:38:07 +0100
committerStruan Donald <struan@exo.org.uk>2011-06-23 14:38:07 +0100
commit11c91b87abe2e89e8dc63a4d541fba7ed1d096b3 (patch)
tree5a315646cda9691ca63fd52f4cb3f9d3aafb1b4b /perllib/FixMyStreet/App/Controller/Report.pm
parent41c7d068f954e062b4da0675b5782211b8ad10c3 (diff)
parent09ce7aeb489e5a43054c3b2b7bfa47fd6aba7c43 (diff)
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into new_statuses
Conflicts: templates/web/default/report/display.html
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm25
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');