From: bbaetz%student.usyd.edu.au <> Date: Thu, 4 Apr 2002 12:19:58 +0000 (+0000) Subject: Bug 126883 - bugzilla.dtd isn't quite correct X-Git-Tag: bugzilla-2.16rc1~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99da5c1938127f39a094e84b1d7e80b84be0ea68;p=thirdparty%2Fbugzilla.git Bug 126883 - bugzilla.dtd isn't quite correct r=gerv, justdave --- diff --git a/Bug.pm b/Bug.pm index 96ff0b8af6..5ae83d2952 100755 --- a/Bug.pm +++ b/Bug.pm @@ -248,7 +248,7 @@ sub emitXML { $xml .= "\n"; - foreach my $field ("bug_id", "urlbase", "bug_status", "product", + foreach my $field ("bug_id", "bug_status", "product", "priority", "version", "rep_platform", "assigned_to", "delta_ts", "component", "reporter", "target_milestone", "bug_severity", "creation_ts", "qa_contact", "op_sys", "resolution", "bug_file_loc", diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 96ff0b8af6..5ae83d2952 100755 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -248,7 +248,7 @@ sub emitXML { $xml .= "\n"; - foreach my $field ("bug_id", "urlbase", "bug_status", "product", + foreach my $field ("bug_id", "bug_status", "product", "priority", "version", "rep_platform", "assigned_to", "delta_ts", "component", "reporter", "target_milestone", "bug_severity", "creation_ts", "qa_contact", "op_sys", "resolution", "bug_file_loc", diff --git a/bugzilla.dtd b/bugzilla.dtd index f9e9c44800..459755ccd8 100644 --- a/bugzilla.dtd +++ b/bugzilla.dtd @@ -5,7 +5,7 @@ maintainer CDATA #REQUIRED exporter CDATA #IMPLIED > - + diff --git a/sanitycheck.cgi b/sanitycheck.cgi index 902557bb8a..80b88d5fd9 100755 --- a/sanitycheck.cgi +++ b/sanitycheck.cgi @@ -140,6 +140,24 @@ if (exists $::FORM{'rebuildvotecache'}) { print "OK, now running sanity checks.

\n"; +# This one goes first, because if this is wrong, then the below tests +# will probably fail too + +# This isn't extensible. Thats OK; we're not adding any more enum fields +Status("Checking for invalid enumeration values"); +foreach my $field (("bug_severity", "bug_status", "op_sys", + "priority", "rep_platform", "resolution")) { + # undefined enum values in mysql are an empty string which equals 0 + SendSQL("SELECT bug_id FROM bugs WHERE $field=0 ORDER BY bug_id"); + my @invalid; + while (MoreSQLData()) { + push (@invalid, FetchOneColumn()); + } + if (@invalid) { + Alert("Bug(s) found with invalid $field value: ".join(', ',@invalid)); + } +} + CrossCheck("keyworddefs", "id", ["keywords", "keywordid"]);