summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Bug.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index d57c0a802..25c2146ef 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -1953,13 +1953,13 @@ sub set_product {
# just die if any of these are invalid.
$self->set_component($comp_name);
$self->set_version($vers_name);
- if ($self->check_can_change_field('target_milestone', 0, 1)) {
- $self->set_target_milestone($tm_name);
- }
- else {
+ if ($product_changed && !$self->check_can_change_field('target_milestone', 0, 1)) {
# Have to set this directly to bypass the validators.
$self->{target_milestone} = $product->default_milestone;
}
+ else {
+ $self->set_target_milestone($tm_name);
+ }
}
if ($product_changed) {