From: lpsolit%gmail.com <> Date: Thu, 20 Nov 2008 01:32:57 +0000 (+0000) Subject: Bug 465606: If a user doesn't have privs to change the target milestone, it gets... X-Git-Tag: bugzilla-3.2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6aac0011c1be4003dc3433fd3c154bdd331a679c;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 dedff7175d..7f2b8d84b9 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -1872,13 +1872,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) {