From f45ef9337770947f5bb36829c0427e14775ffe54 Mon Sep 17 00:00:00 2001 From: Simon Green Date: Sat, 16 Feb 2013 22:55:07 +0100 Subject: Bug 840824: It is possible to create a new bug with a non active target milestone, version or component r/a=LpSolit --- Bugzilla/Bug.pm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 5069214ba..b3f782002 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -1465,8 +1465,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 }); @@ -1929,8 +1928,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( @@ -1960,8 +1958,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 }); -- cgit v1.2.3-24-g4f1b