]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 126883 - bugzilla.dtd isn't quite correct
authorbbaetz%student.usyd.edu.au <>
Thu, 4 Apr 2002 12:19:58 +0000 (12:19 +0000)
committerbbaetz%student.usyd.edu.au <>
Thu, 4 Apr 2002 12:19:58 +0000 (12:19 +0000)
r=gerv, justdave

Bug.pm
Bugzilla/Bug.pm
bugzilla.dtd
sanitycheck.cgi

diff --git a/Bug.pm b/Bug.pm
index 96ff0b8af6a06f2a089fd9aef3e982332b85ce22..5ae83d29525a32ce8eacf10496f8fbaf2f58ae0c 100755 (executable)
--- a/Bug.pm
+++ b/Bug.pm
@@ -248,7 +248,7 @@ sub emitXML {
 
   $xml .= "<bug>\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",
index 96ff0b8af6a06f2a089fd9aef3e982332b85ce22..5ae83d29525a32ce8eacf10496f8fbaf2f58ae0c 100755 (executable)
@@ -248,7 +248,7 @@ sub emitXML {
 
   $xml .= "<bug>\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",
index f9e9c4480001aa4f2ed4a37ef3be694885241dba..459755ccd854fa3a566b01e0b07ad423ba85fee2 100644 (file)
@@ -5,7 +5,7 @@
        maintainer CDATA #REQUIRED
        exporter CDATA #IMPLIED
 >
-<!ELEMENT bug (bug_id, (exporter?, urlbase?, 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?, short_desc?, keywords*, status_whiteboard?, dependson*, blocks*, cc*, long_desc*, attachment*)?)>
+<!ELEMENT bug (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?, short_desc?, keywords*, status_whiteboard?, dependson*, blocks*, cc*, long_desc*, attachment*)?)>
 <!ATTLIST bug
        error (NotFound | NotPermitted | InvalidBugId) #IMPLIED
 >
index 902557bb8ae3c6d450fda064db430470eaff71f6..80b88d5fd9096ed1abcbdb3a188e5bd4e3dca3bc 100755 (executable)
@@ -140,6 +140,24 @@ if (exists $::FORM{'rebuildvotecache'}) {
 
 print "OK, now running sanity checks.<P>\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"]);