]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 140953 - Creating the first attachment status fails. Patch by jouni@heikniemi...
authorgerv%gerv.net <>
Tue, 30 Apr 2002 02:29:52 +0000 (02:29 +0000)
committergerv%gerv.net <>
Tue, 30 Apr 2002 02:29:52 +0000 (02:29 +0000)
editattachstatuses.cgi

index f4176a3218191a12d7dbd3e1c2fd6aea5f83d006..3929940f2408b7728d0f09f01a2e9d4a83014c10 100755 (executable)
@@ -239,7 +239,8 @@ sub insert
 
   SendSQL("LOCK TABLES attachstatusdefs WRITE");
   SendSQL("SELECT MAX(id) FROM attachstatusdefs");
-  my $id = FetchSQLData() + 1;
+  my $id = FetchSQLData() || 0;
+  $id++;
   SendSQL("INSERT INTO attachstatusdefs (id, name, description, sortkey, product)
            VALUES ($id, $name, $desc, $::FORM{'sortkey'}, $product)");
   SendSQL("UNLOCK TABLES");