]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 502682: CheckIfVotedConfirmed fails to confirm a bug if you don't have the permis...
authorlpsolit%gmail.com <>
Tue, 7 Jul 2009 11:11:24 +0000 (11:11 +0000)
committerlpsolit%gmail.com <>
Tue, 7 Jul 2009 11:11:24 +0000 (11:11 +0000)
Bugzilla/Bug.pm

index 3ede4732cec85dad9bf0bc9c3496418eddaba597..b3ddd26342f13617ed8b6347c1263a1d79b9a06a 100644 (file)
@@ -3160,11 +3160,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();