aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-06-09 11:22:54 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-06-09 11:22:54 +0100
commit5d60e828ccd46a805e9463d14f388188efef9f4e (patch)
tree7d2a7b88a8cb7b0dc963a133f3d3230d8878ff94 /perllib/FixMyStreet/App/Controller/Report.pm
parent2f905f6b8f74a5a892b3974e4f0b4076f9b58ddf (diff)
Centralise problem report loading, 404/410 checking.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index 0fe1834e7..497ec784a 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -52,6 +52,7 @@ sub display : Path('') : Args(1) {
}
$c->forward('load_problem_or_display_error', [ $id ] );
+ $c->forward( 'load_updates' );
$c->forward( 'format_problem_for_display' );
}
@@ -76,9 +77,14 @@ sub load_problem_or_display_error : Private {
}
$c->stash->{problem} = $problem;
+ return 1;
+}
+
+sub load_updates : Private {
+ my ( $self, $c ) = @_;
my $updates = $c->model('DB::Comment')->search(
- { problem_id => $problem->id, state => 'confirmed' },
+ { problem_id => $c->stash->{problem}->id, state => 'confirmed' },
{ order_by => 'confirmed' }
);