Last Comment Bug 377025 - doesn't allow you to close a bug
: doesn't allow you to close a bug
[doesn't affect 3.2; 3.0.x only]
Product: Bugzilla
Classification: Server Software
Component: Incoming Email (show other bugs)
: 3.0
: All All
-- normal (vote)
: Bugzilla 3.0
Assigned To: Frédéric Buclin
: default-qa
Depends on: 418863
  Show dependency treegraph
Reported: 2007-04-10 07:39 PDT by David
Modified: 2008-03-23 13:25 PDT (History)
1 user (show)
LpSolit: approval3.0+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---

patch, v1 (1.53 KB, patch)
2008-03-21 10:53 PDT, Frédéric Buclin
mkanat: review+
Details | Diff | Splinter Review

Description User image David 2007-04-10 07:39:55 PDT
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20060202 Fedora/1.0.7-1.2.fc4 Firefox/1.0.7
Build Identifier: 3.0rc1

sending an email with @bug_status=CLOSED sets the bug_status=RESOLVED resolution=FIXED, where it should be set to bug_status=CLOSED, resolution=FIXED

Also, if the bug has a bug_status=CLOSED and resolution=FIXED sending a email with the same will result in the bug_status being changed back to RESOLVED and the resolution remains as FIXED.

The following line:
if ($fields{'resolution'}) {

changes to

if ($fields{'resolution'} && !($fields{'bug_status'} =~ /closed/i) ) {

fixes the problem.

Reproducible: Always

Steps to Reproduce:
1.Send email with containing @bug_status=RESOLVED as well as other appriopriate values.  You see that the status changes from new to RESOLVED
2 manually close the bug, now bug_status=CLOSED.
3. send email with bug_status=CLOSED and it will change back to bug_status=RESOLVED.

you can do steps 1 and 3 and the bug_status will not change to CLOSED.
Comment 1 User image Frédéric Buclin 2008-02-21 10:58:36 PST
I can reproduce as well. We will have to fix bug 418863 first to avoid corrupted data.
Comment 2 User image Frédéric Buclin 2008-03-21 10:53:50 PDT
Created attachment 311007 [details] [diff] [review]
patch, v1

Now correctly handles @bug_status = CLOSED. As explained in bug 418863, you cannot go from NEW to CLOSED in one step. That's not allowed by the (hardcoded) workflow in Bugzilla 3.0. But @bug_status = CLOSED will now correctly change the status of a resolved bug to CLOSED. In the same way, @resolution = FIXED (without @bug_status being specified!) will correctly change the resolution of a resolved bug to FIXED, leaving its status alone. If both @bug_status and @resolution are specified, then @bug_status takes precedence (said otherwise, @resolution can and should only be set together with @bug_status = RESOLVED).

This patch also fixes the incorrect behavior when reopening bugs. It must call "reopen" instead of "clearresolution", which has another meaning.
Comment 3 User image Max Kanat-Alexander 2008-03-22 16:45:52 PDT
Comment on attachment 311007 [details] [diff] [review]
patch, v1

Sure, looks fine.

Another reason why we should implement set_all and switch email_in to use it.
Comment 4 User image Frédéric Buclin 2008-03-23 13:25:20 PDT

Checking in;
/cvsroot/mozilla/webtools/bugzilla/,v  <--
new revision:; previous revision:

Note You need to log in before you can comment on or make changes to this bug.