diff options
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Tokens.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 10 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/LichfieldDC.pm | 10 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/Problem.pm | 4 |
5 files changed, 14 insertions, 14 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 5bf184ae6..87bdc1fd0 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -1063,7 +1063,7 @@ sub redirect_or_confirm_creation : Private { if ( $report->confirmed ) { # Subscribe problem reporter to email updates $c->forward( 'create_reporter_alert' ); - my $report_uri = $c->uri_for( '/report', $report->id ); + my $report_uri = $c->cobrand->base_url_for_report( $report ) . $report->url; $c->log->info($report->user->id . ' was logged in, redirecting to /report/' . $report->id); $c->res->redirect($report_uri); $c->detach; diff --git a/perllib/FixMyStreet/App/Controller/Tokens.pm b/perllib/FixMyStreet/App/Controller/Tokens.pm index 8bab84979..03dc69b00 100644 --- a/perllib/FixMyStreet/App/Controller/Tokens.pm +++ b/perllib/FixMyStreet/App/Controller/Tokens.pm @@ -79,7 +79,7 @@ sub confirm_problem : Path('/P') { $c->set_session_cookie_expire(0); if ( FixMyStreet::DB::Result::Problem->visible_states()->{$old_state} ) { - my $report_uri = $c->uri_for( '/report', $problem->id ); + my $report_uri = $c->cobrand->base_url_for_report( $problem ) . $problem->url; $c->res->redirect($report_uri); } diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 0323edfd5..bcf773d37 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -99,16 +99,16 @@ Return the base url for the cobranded version of the site sub base_url { mySociety::Config::get('BASE_URL') } -=head2 url_for_report +=head2 base_url_for_report -Return the url for a report (might be different in a two-tier county, but +Return the base url for a report (might be different in a two-tier county, but most of the time will be same as base_url). =cut -sub url_for_report { - my ( $self, $problem ) = @_; - return $self->base_url . $problem->url; +sub base_url_for_report { + my ( $self, $report ) = @_; + return $self->base_url; } =head2 base_host diff --git a/perllib/FixMyStreet/Cobrand/LichfieldDC.pm b/perllib/FixMyStreet/Cobrand/LichfieldDC.pm index fb00aec48..5c8a04681 100644 --- a/perllib/FixMyStreet/Cobrand/LichfieldDC.pm +++ b/perllib/FixMyStreet/Cobrand/LichfieldDC.pm @@ -27,13 +27,13 @@ sub disambiguate_location { } # If we ever link to a county problem report, needs to be to main FixMyStreet -sub url_for_report { - my ( $self, $problem ) = @_; - my %councils = map { $_ => 1 } @{$problem->councils}; +sub base_url_for_report { + my ( $self, $report ) = @_; + my %councils = map { $_ => 1 } @{$report->councils}; if ( $councils{2434} ) { - return $self->base_url . $problem->url; + return $self->base_url; } else { - return FixMyStreet->config('BASE_URL') . $problem->url; + return FixMyStreet->config('BASE_URL'); } } diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm index 370c15913..a1f0c196a 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm @@ -250,13 +250,13 @@ sub send_reports { } # Template variables for the email - my $email_base_url = $cobrand->base_url($row->cobrand_data); + my $email_base_url = $cobrand->base_url_for_report($row); my %h = map { $_ => $row->$_ } qw/id title detail name category latitude longitude used_map/; map { $h{$_} = $row->user->$_ } qw/email phone/; $h{confirmed} = DateTime::Format::Pg->format_datetime( $row->confirmed->truncate (to => 'second' ) ); $h{query} = $row->postcode; - $h{url} = $email_base_url . '/report/' . $row->id; + $h{url} = $email_base_url . $row->url; $h{phone_line} = $h{phone} ? _('Phone:') . " $h{phone}\n\n" : ''; if ($row->photo) { $h{has_photo} = _("This web page also contains a photo of the problem, provided by the user.") . "\n\n"; |