summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-02-18 04:33:51 +0100
committerDave Lawrence <dlawrence@mozilla.com>2013-02-18 04:33:51 +0100
commit744a02114ab467888f3cc82689d9b3d0cd6ba9f8 (patch)
treee477269e2616f58ac8a524b0a7921160945c5e96
parentce16ab89d78d2299c9afb8e18c2a1d6454fcbafe (diff)
downloadbugzilla-744a02114ab467888f3cc82689d9b3d0cd6ba9f8.tar.gz
bugzilla-744a02114ab467888f3cc82689d9b3d0cd6ba9f8.tar.xz
Bug 840824: It is possible to create a new bug with a non active target milestone, version or component
-rw-r--r--Bugzilla/Bug.pm9
1 files changed, 3 insertions, 6 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 3d3a92838..760486be6 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -1481,8 +1481,7 @@ sub _check_component {
$name || ThrowUserError("require_component");
my $product = blessed($invocant) ? $invocant->product_obj
: $params->{product};
- my $old_comp = blessed($invocant) ? $invocant->component
- : $params->{component};
+ my $old_comp = blessed($invocant) ? $invocant->component : '';
my $object = Bugzilla::Component->check({ product => $product, name => $name });
if ($object->name ne $old_comp && !$object->is_active) {
ThrowUserError('value_inactive', { class => ref($object), value => $name });
@@ -1942,8 +1941,7 @@ sub _check_target_milestone {
my ($invocant, $target, undef, $params) = @_;
my $product = blessed($invocant) ? $invocant->product_obj
: $params->{product};
- my $old_target = blessed($invocant) ? $invocant->target_milestone
- : $params->{target_milestone};
+ my $old_target = blessed($invocant) ? $invocant->target_milestone : '';
$target = trim($target);
$target = $product->default_milestone if !defined $target;
my $object = Bugzilla::Milestone->check(
@@ -1973,8 +1971,7 @@ sub _check_version {
$version = trim($version);
my $product = blessed($invocant) ? $invocant->product_obj
: $params->{product};
- my $old_vers = blessed($invocant) ? $invocant->version
- : $params->{version};
+ my $old_vers = blessed($invocant) ? $invocant->version : '';
my $object = Bugzilla::Version->check({ product => $product, name => $version });
if ($object->name ne $old_vers && !$object->is_active) {
ThrowUserError('value_inactive', { class => ref($object), value => $version });