summaryrefslogtreecommitdiffstats
path: root/editclassifications.cgi
diff options
context:
space:
mode:
authortravis%sedsystems.ca <>2005-03-16 08:56:18 +0100
committertravis%sedsystems.ca <>2005-03-16 08:56:18 +0100
commitaee162e136563f102cc476ffe8d100905f900370 (patch)
tree2e2df22d226a0412d83c92581f46a4022639ecfd /editclassifications.cgi
parente490b45d57aee2aacd171a4a9b586111a8c88f53 (diff)
downloadbugzilla-aee162e136563f102cc476ffe8d100905f900370.tar.gz
bugzilla-aee162e136563f102cc476ffe8d100905f900370.tar.xz
Bug 286286 : Incorrect name check when adding a new classification
Patch by Frederic Buclin <LpSolit@gmail.com> r=jake a=myk
Diffstat (limited to 'editclassifications.cgi')
-rwxr-xr-xeditclassifications.cgi20
1 files changed, 12 insertions, 8 deletions
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";