summaryrefslogtreecommitdiffstats
path: root/editattachstatuses.cgi
diff options
context:
space:
mode:
authorgerv%gerv.net <>2002-04-30 04:29:52 +0200
committergerv%gerv.net <>2002-04-30 04:29:52 +0200
commitddd9ebd5c577e5f0bcf2f0b30f0dba34b95dbeb3 (patch)
treeb9734d507b22416a3e105dcf8522809e4f29d237 /editattachstatuses.cgi
parent947bd2d3aaafa546d2666874a5fc36aefbf6710e (diff)
downloadbugzilla-ddd9ebd5c577e5f0bcf2f0b30f0dba34b95dbeb3.tar.gz
bugzilla-ddd9ebd5c577e5f0bcf2f0b30f0dba34b95dbeb3.tar.xz
Bug 140953 - Creating the first attachment status fails. Patch by jouni@heikniemi.net, 2xr=myk.
Diffstat (limited to 'editattachstatuses.cgi')
-rwxr-xr-xeditattachstatuses.cgi3
1 files changed, 2 insertions, 1 deletions
diff --git a/editattachstatuses.cgi b/editattachstatuses.cgi
index f4176a321..3929940f2 100755
--- a/editattachstatuses.cgi
+++ b/editattachstatuses.cgi
@@ -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");