From: gerv%gerv.net <> Date: Tue, 30 Apr 2002 02:29:52 +0000 (+0000) Subject: Bug 140953 - Creating the first attachment status fails. Patch by jouni@heikniemi... X-Git-Tag: bugzilla-2.16rc1~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddd9ebd5c577e5f0bcf2f0b30f0dba34b95dbeb3;p=thirdparty%2Fbugzilla.git Bug 140953 - Creating the first attachment status fails. Patch by jouni@heikniemi.net, 2xr=myk. --- diff --git a/editattachstatuses.cgi b/editattachstatuses.cgi index f4176a3218..3929940f24 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");