]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 161865 - GetFieldID shouldn't INSERT into the fielddefs table
authorbbaetz%student.usyd.edu.au <>
Sat, 10 Aug 2002 14:34:16 +0000 (14:34 +0000)
committerbbaetz%student.usyd.edu.au <>
Sat, 10 Aug 2002 14:34:16 +0000 (14:34 +0000)
r=joel x2

checksetup.pl
globals.pl

index ea4377fe98a184c91bec104119f012455eb56d54..74d0087086ba2e33837e2c112a965ef2ddb62c5a 100755 (executable)
@@ -1746,6 +1746,9 @@ sub AddFDef ($$$) {
 }
 
 
+# Note that all of these entries are unconditional, from when GetFieldID
+# used to create an entry if it wasn't found. New fielddef columns should
+# be created with their associated schema change.
 AddFDef("bug_id", "Bug \#", 1);
 AddFDef("short_desc", "Summary", 1);
 AddFDef("product", "Product", 1);
@@ -1779,9 +1782,10 @@ AddFDef("(to_days(now()) - to_days(bugs.delta_ts))", "Days since bug changed",
         0);
 AddFDef("longdesc", "Comment", 0);
 AddFDef("alias", "Alias", 0);
-    
-    
-
+AddFDef("everconfirmed", "Ever Confirmed", 0);
+AddFDef("groupset", "Groupset", 0);
+AddFDef("reporter_accessible", "Reporter Accessible", 0);
+AddFDef("cc_accessible", "CC Accessible", 0);
 
 ###########################################################################
 # Detect changed local settings
index ec57bffb2be07aa9311a9b814a14c566d7e307aa..cdaf845124d6e50d6cc813f890e20892b41e07a8 100644 (file)
@@ -349,12 +349,7 @@ sub GetFieldID {
     my ($f) = (@_);
     SendSQL("SELECT fieldid FROM fielddefs WHERE name = " . SqlQuote($f));
     my $fieldid = FetchOneColumn();
-    if (!$fieldid) {
-        my $q = SqlQuote($f);
-        SendSQL("REPLACE INTO fielddefs (name, description) VALUES ($q, $q)");
-        SendSQL("SELECT LAST_INSERT_ID()");
-        $fieldid = FetchOneColumn();
-    }
+    die "Unknown field id: $f" if !$fieldid;
     return $fieldid;
 }