]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 286286 : Incorrect name check when adding a new classification
authortravis%sedsystems.ca <>
Wed, 16 Mar 2005 07:56:18 +0000 (07:56 +0000)
committertravis%sedsystems.ca <>
Wed, 16 Mar 2005 07:56:18 +0000 (07:56 +0000)
Patch by Frederic Buclin <LpSolit@gmail.com>   r=jake  a=myk

editclassifications.cgi

index 7fd26366bcec9f76c4e16b4d1629fb32bbc4abd3..1a1e48026651875f309e0c50766657bb16e7367e 100755 (executable)
@@ -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";