From: lpsolit%gmail.com <> Date: Tue, 7 Jul 2009 11:09:57 +0000 (+0000) Subject: Bug 502682: CheckIfVotedConfirmed fails to confirm a bug if you don't have the permis... X-Git-Tag: bugzilla-3.4rc1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e09050f89554fba64e6d7f2bd7693dc5e54072b;p=thirdparty%2Fbugzilla.git Bug 502682: CheckIfVotedConfirmed fails to confirm a bug if you don't have the permissions to set status/everconfirmed - Patch by Frédéric Buclin r/a=mkanat --- diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index a2db3572ab..dbb88be6a1 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -3373,11 +3373,17 @@ sub CheckIfVotedConfirmed { } ThrowCodeError('no_open_bug_status') unless $new_status; - $bug->set_status($new_status); + # We cannot call $bug->set_status() here, because a user without + # canconfirm privs should still be able to confirm a bug by + # popular vote. We already know the new status is valid, so it's safe. + $bug->{bug_status} = $new_status; + $bug->{everconfirmed} = 1; + delete $bug->{'status'}; # Contains the status object. } else { # If the bug is in a closed state, only set everconfirmed to 1. - $bug->_set_everconfirmed(1); + # Do not call $bug->_set_everconfirmed(), for the same reason as above. + $bug->{everconfirmed} = 1; } $bug->update();