]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 256004: Fix regression that caused duplicate sortkeys in the fielddefs table
authorjustdave%bugzilla.org <>
Wed, 15 Sep 2004 07:58:32 +0000 (07:58 +0000)
committerjustdave%bugzilla.org <>
Wed, 15 Sep 2004 07:58:32 +0000 (07:58 +0000)
r=myk, a=justdave

checksetup.pl

index 6b9b1042cfae3ad17fc70e8f1c126ced561b5e89..9d2ca4241daf82ab5f4338b44f648a20dd16df5a 100755 (executable)
@@ -2138,11 +2138,11 @@ sub AddFDef ($$$) {
         $dbh->do("INSERT INTO fielddefs " .
              "(fieldid, name, description, mailhead, sortkey) VALUES " .
              "($fieldid, $name, $description, $mailhead, $headernum)");
-        $headernum++;
     } else {
         $dbh->do("UPDATE fielddefs SET name = $name, description = $description, " .
-                 "mailhead = $mailhead WHERE fieldid = $fieldid");
+                 "mailhead = $mailhead, sortkey = $headernum WHERE fieldid = $fieldid");
     }
+    $headernum++;
 }