From aee162e136563f102cc476ffe8d100905f900370 Mon Sep 17 00:00:00 2001 From: "travis%sedsystems.ca" <> Date: Wed, 16 Mar 2005 07:56:18 +0000 Subject: Bug 286286 : Incorrect name check when adding a new classification Patch by Frederic Buclin r=jake a=myk --- editclassifications.cgi | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'editclassifications.cgi') diff --git a/editclassifications.cgi b/editclassifications.cgi index 7fd26366b..1a1e48026 100755 --- a/editclassifications.cgi +++ b/editclassifications.cgi @@ -148,6 +148,9 @@ if ($action eq 'add') { # if ($action eq 'new') { + unless ($classification) { + ThrowUserError("classification_not_specified"); + } if (TestClassification($classification)) { ThrowUserError("classification_already_exists", { name => $classification }); } @@ -290,14 +293,6 @@ if ($action eq 'update') { $dbh->bz_lock_tables('classifications WRITE'); - if ($description ne $descriptionold) { - $sth = $dbh->prepare("UPDATE classifications - SET description=? - WHERE id=?"); - $sth->execute($description,$classification_id); - $vars->{'updated_description'} = 1; - } - if ($classification ne $classificationold) { unless ($classification) { ThrowUserError("classification_not_specified"); @@ -311,6 +306,15 @@ if ($action eq 'update') { $sth->execute($classification,$classification_id); $vars->{'updated_classification'} = 1; } + + if ($description ne $descriptionold) { + $sth = $dbh->prepare("UPDATE classifications + SET description=? + WHERE id=?"); + $sth->execute($description,$classification_id); + $vars->{'updated_description'} = 1; + } + $dbh->bz_unlock_tables(); unlink "data/versioncache"; -- cgit v1.2.3-24-g4f1b