summaryrefslogtreecommitdiffstats
path: root/editflagtypes.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-08-08 07:13:59 +0200
committerlpsolit%gmail.com <>2006-08-08 07:13:59 +0200
commit5c377e30d41de59b2c00beaea45710445e70f2c9 (patch)
tree643b3ebcbbb7fe45f0ce675cdfb7b930fdd3746f /editflagtypes.cgi
parent7826a3a493f9d4b36cbbb177b2ab3d244624e6b2 (diff)
downloadbugzilla-5c377e30d41de59b2c00beaea45710445e70f2c9.tar.gz
bugzilla-5c377e30d41de59b2c00beaea45710445e70f2c9.tar.xz
Bug 347521: flagtypes.id should be an auto-increment field - Patch by Frédéric Buclin <LpSolit@gmail.com> r=bkor a=myk
Diffstat (limited to 'editflagtypes.cgi')
-rwxr-xr-xeditflagtypes.cgi12
1 files changed, 6 insertions, 6 deletions
diff --git a/editflagtypes.cgi b/editflagtypes.cgi
index 3c71d5bdb..622cfcb05 100755
--- a/editflagtypes.cgi
+++ b/editflagtypes.cgi
@@ -306,22 +306,22 @@ sub insert {
'components READ', 'flaginclusions WRITE',
'flagexclusions WRITE');
- # Determine the new flag type's unique identifier.
- my $id = $dbh->selectrow_array('SELECT MAX(id) FROM flagtypes') + 1;
-
# Insert a record for the new flag type into the database.
$dbh->do('INSERT INTO flagtypes
- (id, name, description, cc_list, target_type,
+ (name, description, cc_list, target_type,
sortkey, is_active, is_requestable,
is_requesteeble, is_multiplicable,
grant_group_id, request_group_id)
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
- undef, ($id, $name, $description, $cc_list, $target_type,
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
+ undef, ($name, $description, $cc_list, $target_type,
$cgi->param('sortkey'), $cgi->param('is_active'),
$cgi->param('is_requestable'), $cgi->param('is_requesteeble'),
$cgi->param('is_multiplicable'), scalar($cgi->param('grant_gid')),
scalar($cgi->param('request_gid'))));
+ # Get the ID of the new flag type.
+ my $id = $dbh->bz_last_key('flagtypes', 'id');
+
# Populate the list of inclusions/exclusions for this flag type.
validateAndSubmit($id);