aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2015-08-13 12:21:20 +0100
committerMatthew Somerville <matthew@mysociety.org>2015-08-13 13:38:14 +0100
commitef3a3a789e8f91b62dc562ff69781dc0daa80871 (patch)
tree6045ce7399229bfcb2eca4090f1707d6fc79830b /perllib/FixMyStreet/App/Controller
parent864fcb6a81b17ec6324598973ff29dd734a7baf8 (diff)
Remove ms_current_timestamp() override function.
This override is not used anywhere, it dates from a very old long-gone test script, and causes issues with database query planning.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm14
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Questionnaire.pm12
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm2
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/Update.pm2
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm12
-rw-r--r--perllib/FixMyStreet/App/Controller/Tokens.pm8
6 files changed, 25 insertions, 25 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 6145a6eb0..44b898743 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -359,7 +359,7 @@ sub update_contacts : Private {
$contact->deleted( $c->get_param('deleted') ? 1 : 0 );
$contact->non_public( $c->get_param('non_public') ? 1 : 0 );
$contact->note( $c->get_param('note') );
- $contact->whenedited( \'ms_current_timestamp()' );
+ $contact->whenedited( \'current_timestamp' );
$contact->editor( $editor );
$contact->endpoint( $c->get_param('endpoint') );
$contact->jurisdiction( $c->get_param('jurisdiction') );
@@ -395,7 +395,7 @@ sub update_contacts : Private {
$contacts->update(
{
confirmed => 1,
- whenedited => \'ms_current_timestamp()',
+ whenedited => \'current_timestamp',
note => 'Confirmed',
editor => $editor,
}
@@ -707,7 +707,7 @@ sub report_edit : Path('report_edit') : Args(1) {
}
elsif ( $c->get_param('mark_sent') ) {
$c->forward('check_token');
- $problem->whensent(\'ms_current_timestamp()');
+ $problem->whensent(\'current_timestamp');
$problem->update();
$c->stash->{status_message} = '<p><em>' . _('That problem has been marked as sent.') . '</em></p>';
$c->forward( 'log_edit', [ $id, 'problem', 'marked sent' ] );
@@ -787,14 +787,14 @@ sub report_edit : Path('report_edit') : Args(1) {
}
if ( $problem->is_visible() and $old_state eq 'unconfirmed' ) {
- $problem->confirmed( \'ms_current_timestamp()' );
+ $problem->confirmed( \'current_timestamp' );
}
if ($done) {
$problem->discard_changes;
}
else {
- $problem->lastupdate( \'ms_current_timestamp()' ) if $edited || $new_state ne $old_state;
+ $problem->lastupdate( \'current_timestamp' ) if $edited || $new_state ne $old_state;
$problem->update;
if ( $new_state ne $old_state ) {
@@ -943,10 +943,10 @@ sub update_edit : Path('update_edit') : Args(1) {
}
if ( $new_state eq 'confirmed' and $old_state eq 'unconfirmed' ) {
- $update->confirmed( \'ms_current_timestamp()' );
+ $update->confirmed( \'current_timestamp' );
if ( $update->problem_state && $update->created > $update->problem->lastupdate ) {
$update->problem->state( $update->problem_state );
- $update->problem->lastupdate( \'ms_current_timestamp()' );
+ $update->problem->lastupdate( \'current_timestamp' );
$update->problem->update;
}
}
diff --git a/perllib/FixMyStreet/App/Controller/Questionnaire.pm b/perllib/FixMyStreet/App/Controller/Questionnaire.pm
index f9a08e408..035cab3a6 100755
--- a/perllib/FixMyStreet/App/Controller/Questionnaire.pm
+++ b/perllib/FixMyStreet/App/Controller/Questionnaire.pm
@@ -142,8 +142,8 @@ sub submit_creator_fixed : Private {
$questionnaire->ever_reported( $c->stash->{reported} eq 'Yes' ? 1 : 0 );
$questionnaire->old_state( $old_state );
- $questionnaire->whensent( \'ms_current_timestamp()' );
- $questionnaire->whenanswered( \'ms_current_timestamp()' );
+ $questionnaire->whensent( \'current_timestamp' );
+ $questionnaire->whenanswered( \'current_timestamp' );
$questionnaire->insert;
}
@@ -173,13 +173,13 @@ sub submit_standard : Private {
# Record state change, if there was one
if ( $new_state ) {
$problem->state( $new_state );
- $problem->lastupdate( \'ms_current_timestamp()' );
+ $problem->lastupdate( \'current_timestamp' );
}
# If it's not fixed and they say it's still not been fixed, record time update
if ( $c->stash->{been_fixed} eq 'No' &&
FixMyStreet::DB::Result::Problem->open_states->{$old_state} ) {
- $problem->lastupdate( \'ms_current_timestamp()' );
+ $problem->lastupdate( \'current_timestamp' );
}
# Record questionnaire response
@@ -189,7 +189,7 @@ sub submit_standard : Private {
my $q = $c->stash->{questionnaire};
$q->update( {
- whenanswered => \'ms_current_timestamp()',
+ whenanswered => \'current_timestamp',
ever_reported => $reported,
old_state => $old_state,
new_state => $c->stash->{been_fixed} eq 'Unknown' ? 'unknown' : ($new_state || $old_state),
@@ -210,7 +210,7 @@ sub submit_standard : Private {
lang => $c->stash->{lang_code},
cobrand => $c->cobrand->moniker,
cobrand_data => '',
- confirmed => \'ms_current_timestamp()',
+ confirmed => \'current_timestamp',
anonymous => $problem->anonymous,
}
);
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index 7b001ee4c..315a5436c 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -242,7 +242,7 @@ sub delete :Local :Args(1) {
return $c->res->redirect($uri) unless $p->bodies->{$body->id};
$p->state('hidden');
- $p->lastupdate( \'ms_current_timestamp()' );
+ $p->lastupdate( \'current_timestamp' );
$p->update;
$c->model('DB::AdminLog')->create( {
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm
index 17aec2113..445723fec 100644
--- a/perllib/FixMyStreet/App/Controller/Report/Update.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm
@@ -80,7 +80,7 @@ sub update_problem : Private {
$problem->interest_count( \'interest_count + 1' );
}
- $problem->lastupdate( \'ms_current_timestamp()' );
+ $problem->lastupdate( \'current_timestamp' );
$problem->update;
$c->stash->{problem_id} = $problem->id;
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index 6b0d516a6..4582843bd 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -396,20 +396,20 @@ sub load_and_group_problems : Private {
my $not_open = [ FixMyStreet::DB::Result::Problem::fixed_states(), FixMyStreet::DB::Result::Problem::closed_states() ];
if ( $type eq 'new' ) {
- $where->{confirmed} = { '>', \"ms_current_timestamp() - INTERVAL '4 week'" };
+ $where->{confirmed} = { '>', \"current_timestamp - INTERVAL '4 week'" };
$where->{state} = { 'IN', [ FixMyStreet::DB::Result::Problem::open_states() ] };
} elsif ( $type eq 'older' ) {
- $where->{confirmed} = { '<', \"ms_current_timestamp() - INTERVAL '4 week'" };
- $where->{lastupdate} = { '>', \"ms_current_timestamp() - INTERVAL '8 week'" };
+ $where->{confirmed} = { '<', \"current_timestamp - INTERVAL '4 week'" };
+ $where->{lastupdate} = { '>', \"current_timestamp - INTERVAL '8 week'" };
$where->{state} = { 'IN', [ FixMyStreet::DB::Result::Problem::open_states() ] };
} elsif ( $type eq 'unknown' ) {
- $where->{lastupdate} = { '<', \"ms_current_timestamp() - INTERVAL '8 week'" };
+ $where->{lastupdate} = { '<', \"current_timestamp - INTERVAL '8 week'" };
$where->{state} = { 'IN', [ FixMyStreet::DB::Result::Problem::open_states() ] };
} elsif ( $type eq 'fixed' ) {
- $where->{lastupdate} = { '>', \"ms_current_timestamp() - INTERVAL '8 week'" };
+ $where->{lastupdate} = { '>', \"current_timestamp - INTERVAL '8 week'" };
$where->{state} = $not_open;
} elsif ( $type eq 'older_fixed' ) {
- $where->{lastupdate} = { '<', \"ms_current_timestamp() - INTERVAL '8 week'" };
+ $where->{lastupdate} = { '<', \"current_timestamp - INTERVAL '8 week'" };
$where->{state} = $not_open;
}
diff --git a/perllib/FixMyStreet/App/Controller/Tokens.pm b/perllib/FixMyStreet/App/Controller/Tokens.pm
index 21c269502..ba15162ce 100644
--- a/perllib/FixMyStreet/App/Controller/Tokens.pm
+++ b/perllib/FixMyStreet/App/Controller/Tokens.pm
@@ -58,7 +58,7 @@ sub confirm_problem : Path('/P') {
# check that this email or domain are not the cause of abuse. If so hide it.
if ( $problem->is_from_abuser ) {
$problem->update(
- { state => 'hidden', lastupdate => \'ms_current_timestamp()' } );
+ { state => 'hidden', lastupdate => \'current_timestamp' } );
$c->stash->{template} = 'tokens/abuse.html';
return;
}
@@ -68,7 +68,7 @@ sub confirm_problem : Path('/P') {
if ($c->cobrand->moniker eq 'zurich') {
$problem->set_extra_metadata( email_confirmed => 1 );
$problem->update( {
- confirmed => \'ms_current_timestamp()',
+ confirmed => \'current_timestamp',
} );
if ( $data->{name} || $data->{password} ) {
@@ -90,8 +90,8 @@ sub confirm_problem : Path('/P') {
$problem->update(
{
state => 'confirmed',
- confirmed => \'ms_current_timestamp()',
- lastupdate => \'ms_current_timestamp()',
+ confirmed => \'current_timestamp',
+ lastupdate => \'current_timestamp',
}
);