summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2008-06-13 22:59:28 +0200
committerlpsolit%gmail.com <>2008-06-13 22:59:28 +0200
commit1a612f5e8e93aad68933504051063800b985d398 (patch)
treebfbafa50d411ec62dc961c52708e53ce9459d543
parente40ada61703c1959e2f8291ff1a27178db409832 (diff)
downloadbugzilla-1a612f5e8e93aad68933504051063800b985d398.tar.gz
bugzilla-1a612f5e8e93aad68933504051063800b985d398.tar.xz
Bug 437770: Imported bugs are ignored by queries (they never appear in buglists) - Patch by Ed Goose <ed.goose@gmail.com> r/a=LpSolit
-rwxr-xr-xsanitycheck.cgi27
-rw-r--r--template/en/default/admin/sanitycheck/messages.html.tmpl15
2 files changed, 42 insertions, 0 deletions
diff --git a/sanitycheck.cgi b/sanitycheck.cgi
index 237eaab38..171029b2e 100755
--- a/sanitycheck.cgi
+++ b/sanitycheck.cgi
@@ -29,6 +29,7 @@ use strict;
use lib qw(. lib);
use Bugzilla;
+use Bugzilla::Bug;
use Bugzilla::Constants;
use Bugzilla::Util;
use Bugzilla::Error;
@@ -222,6 +223,26 @@ if ($cgi->param('repair_creation_date')) {
}
###########################################################################
+# Fix entries in Bugs full_text
+###########################################################################
+
+if ($cgi->param('repair_bugs_fulltext')) {
+ Status('bugs_fulltext_start');
+
+ my $bug_ids = $dbh->selectcol_arrayref('SELECT bugs.bug_id
+ FROM bugs
+ LEFT JOIN bugs_fulltext
+ ON bugs_fulltext.bug_id = bugs.bug_id
+ WHERE bugs_fulltext.bug_id IS NULL');
+
+ foreach my $bugid (@$bug_ids) {
+ Bugzilla::Bug->new($bugid)->_sync_fulltext('new_bug');
+ }
+
+ Status('bugs_fulltext_fixed', {bug_count => scalar(@$bug_ids)});
+}
+
+###########################################################################
# Send unsent mail
###########################################################################
@@ -864,6 +885,12 @@ Status('bug_check_creation_date');
BugCheck("bugs WHERE creation_ts IS NULL", 'bug_check_creation_date_error_text',
'repair_creation_date', 'bug_check_creation_date_repair_text');
+Status('bug_check_bugs_fulltext');
+
+BugCheck("bugs LEFT JOIN bugs_fulltext ON bugs_fulltext.bug_id = bugs.bug_id " .
+ "WHERE bugs_fulltext.bug_id IS NULL", 'bug_check_bugs_fulltext_error_text',
+ 'repair_bugs_fulltext', 'bug_check_bugs_fulltext_repair_text');
+
Status('bug_check_res_dupl');
BugCheck("bugs INNER JOIN duplicates ON bugs.bug_id = duplicates.dupe " .
diff --git a/template/en/default/admin/sanitycheck/messages.html.tmpl b/template/en/default/admin/sanitycheck/messages.html.tmpl
index f493e403c..4300f7815 100644
--- a/template/en/default/admin/sanitycheck/messages.html.tmpl
+++ b/template/en/default/admin/sanitycheck/messages.html.tmpl
@@ -45,6 +45,15 @@
[% ELSIF san_tag == "bug_check_creation_date_repair_text" %]
Repair missing creation date for these [% terms.bugs %]
+ [% ELSIF san_tag == "bug_check_bugs_fulltext" %]
+ Checking for [% terms.bugs %] with no entry for full text searching.
+
+ [% ELSIF san_tag == "bug_check_bugs_fulltext_error_text" %]
+ [% terms.Bugs %] with no entry for full text searching
+
+ [% ELSIF san_tag == "bug_check_bugs_fulltext_repair_text" %]
+ Repair missing full text search entries for these [% terms.bugs %]
+
[% ELSIF san_tag == "bug_check_res_dupl" %]
Checking resolution/duplicates
@@ -103,6 +112,12 @@
[% ELSIF san_tag == "bug_creation_date_fixed" %]
[% bug_count FILTER html %] [%+ terms.bugs %] have been fixed.
+ [% ELSIF san_tag == "bugs_fulltext_start" %]
+ OK, now fixing [% terms.bug %] entries for full text searching.
+
+ [% ELSIF san_tag == "bugs_fulltext_fixed" %]
+ [% bug_count FILTER html %] [%+ terms.bugs %] have been fixed.
+
[% ELSIF san_tag == "bug_reference_deletion_start" %]
OK, now removing all references to deleted [% terms.bugs %].