diff options
-rwxr-xr-x | sanitycheck.cgi | 20 | ||||
-rw-r--r-- | template/en/default/admin/sanitycheck/messages.html.tmpl | 6 |
2 files changed, 24 insertions, 2 deletions
diff --git a/sanitycheck.cgi b/sanitycheck.cgi index c43641fb6..69ab80faf 100755 --- a/sanitycheck.cgi +++ b/sanitycheck.cgi @@ -219,6 +219,22 @@ if ($cgi->param('repair_creation_date')) { } ########################################################################### +# Fix everconfirmed +########################################################################### + +if ($cgi->param('repair_everconfirmed')) { + Status('everconfirmed_start'); + + my @confirmed_open_states = grep {$_ ne 'UNCONFIRMED'} BUG_STATE_OPEN; + my $confirmed_open_states = join(', ', map {$dbh->quote($_)} @confirmed_open_states); + + $dbh->do("UPDATE bugs SET everconfirmed = 0 WHERE bug_status = 'UNCONFIRMED'"); + $dbh->do("UPDATE bugs SET everconfirmed = 1 WHERE bug_status IN ($confirmed_open_states)"); + + Status('everconfirmed_end'); +} + +########################################################################### # Fix entries in Bugs full_text ########################################################################### @@ -939,13 +955,13 @@ BugCheck("bugs WHERE bug_status NOT IN ($open_states) AND resolution = ''", Status('bug_check_status_everconfirmed'); BugCheck("bugs WHERE bug_status = 'UNCONFIRMED' AND everconfirmed = 1", - 'bug_check_status_everconfirmed_error_text'); + 'bug_check_status_everconfirmed_error_text', 'repair_everconfirmed'); my @confirmed_open_states = grep {$_ ne 'UNCONFIRMED'} BUG_STATE_OPEN; my $confirmed_open_states = join(', ', map {$dbh->quote($_)} @confirmed_open_states); BugCheck("bugs WHERE bug_status IN ($confirmed_open_states) AND everconfirmed = 0", - 'bug_check_status_everconfirmed_error_text2'); + 'bug_check_status_everconfirmed_error_text2', 'repair_everconfirmed'); Status('bug_check_votes_everconfirmed'); diff --git a/template/en/default/admin/sanitycheck/messages.html.tmpl b/template/en/default/admin/sanitycheck/messages.html.tmpl index b65f8eac5..b67e5982d 100644 --- a/template/en/default/admin/sanitycheck/messages.html.tmpl +++ b/template/en/default/admin/sanitycheck/messages.html.tmpl @@ -169,6 +169,12 @@ [% END %] [% END %] + [% ELSIF san_tag == "everconfirmed_start" %] + OK, now fixing everconfirmed. + + [% ELSIF san_tag == "everconfirmed_end" %] + everconfirmed fixed. + [% ELSIF san_tag == "flag_check_start" %] Checking for flags being in the wrong product/component. |