aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-10-26 16:23:41 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-10-26 16:23:41 +0100
commit0d3c0ee6390aed6bec647b04ee35d575fcb26543 (patch)
treee8a13b33322017689b5b7c42dbae735fabc0e139 /perllib/FixMyStreet/App/Controller/Report.pm
parenteb4e1f1f98c3bfba73d12e192c4c6d5f9fb71710 (diff)
parent428466512607541a1d82de6e721439a0d0e7446c (diff)
Merge branch 'issues/forcouncils/44-two-tier-change-category'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index f69bdc8c0..73479c584 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -390,7 +390,17 @@ sub inspect : Private {
anonymous => 0,
} );
}
- $c->res->redirect( $c->uri_for( '/report', $problem->id ) );
+ # 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
+ my $redirect_uri;
+ if ( $c->cobrand->is_council && !$c->cobrand->owns_problem($problem) ) {
+ $redirect_uri = $c->cobrand->base_url_for_report( $problem ) . $problem->url;
+ } else {
+ $redirect_uri = $c->uri_for( $problem->url );
+ }
+ $c->log->debug( "Redirecting to: " . $redirect_uri );
+ $c->res->redirect( $redirect_uri );
}
}
};