From: lpsolit%gmail.com <> Date: Thu, 20 Nov 2008 01:30:27 +0000 (+0000) Subject: Bug 465606: If a user doesn't have privs to change the target milestone, it gets... X-Git-Tag: bugzilla-3.3.1~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=864ee35126ff8053ee46d559f9f4dd53dd871ffd;p=thirdparty%2Fbugzilla.git Bug 465606: If a user doesn't have privs to change the target milestone, it gets set back to default - Patch by Frédéric Buclin r/a=mkanat --- diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index d57c0a802a..25c2146ef9 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) {