aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App.pm8
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm2
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm6
3 files changed, 14 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm
index cf766348f..4f70d2c68 100644
--- a/perllib/FixMyStreet/App.pm
+++ b/perllib/FixMyStreet/App.pm
@@ -208,6 +208,14 @@ sub setup_request {
DateTime->DefaultLocale( 'en_US' );
}
+ if (FixMyStreet->test_mode) {
+ # Is there a better way of altering $c->config that may have
+ # override_config involved?
+ $c->setup_finished(0);
+ $c->config( %{ FixMyStreet->config() } );
+ $c->setup_finished(1);
+ }
+
return $c;
}
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 822860487..07bd61cbb 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -765,7 +765,7 @@ sub report_edit : Path('report_edit') : Args(1) {
$problem->photo(undef);
}
- if ( $new_state eq 'confirmed' and $old_state eq 'unconfirmed' ) {
+ if ( $problem->is_visible() and $old_state eq 'unconfirmed' ) {
$problem->confirmed( \'ms_current_timestamp()' );
}
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 6018dfa80..59d38a6cf 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -956,7 +956,11 @@ sub check_for_errors : Private {
delete $field_errors{name};
my $report = $c->stash->{report};
$report->title( Utils::cleanup_text( substr($report->detail, 0, 25) ) );
- if ( ! $c->req->param('phone') ) {
+
+ # We only want to validate the phone number web requests (where the
+ # service parameter is blank) because previous versions of the mobile
+ # apps don't validate the presence of a phone number.
+ if ( ! $c->req->param('phone') and ! $c->req->param('service') ) {
$field_errors{phone} = _("This information is required");
}
}