aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm1
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm3
2 files changed, 4 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index a410c2d91..c617f5733 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -441,6 +441,7 @@ sub inspect : Private {
# This problem might no longer be visible on the current cobrand,
# if its body has changed (e.g. by virtue of the category changing)
# so redirect to a cobrand where it can be seen if necessary
+ $problem->discard_changes;
my $redirect_uri;
if ( $c->cobrand->is_council && !$c->cobrand->owns_problem($problem) ) {
$redirect_uri = $c->cobrand->base_url_for_report( $problem ) . $problem->url;
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index fbb0e94a1..20ec8f0a2 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -414,6 +414,9 @@ sub load_and_group_problems : Private {
order_by => $c->stash->{sort_order},
rows => $c->cobrand->reports_per_page,
};
+ if ($c->user_exists && $c->stash->{body} && $c->user->has_permission_to('planned_reports', $c->stash->{body}->id)) {
+ $filter->{prefetch} = 'user_planned_reports';
+ }
if (defined $c->stash->{filter_status}{shortlisted}) {
$where->{'me.id'} = { '=', \"user_planned_reports.report_id"};