Last Comment Bug 377025 - email_in.pl doesn't allow you to close a bug
: email_in.pl doesn't allow you to close a bug
Status: RESOLVED FIXED
[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
Mentors:
Depends on: 418863
Blocks:
  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: ---


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

Description 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.

Also,
you can do steps 1 and 3 and the bug_status will not change to CLOSED.
Comment 1 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 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 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 Frédéric Buclin 2008-03-23 13:25:20 PDT
3.0.3:

Checking in email_in.pl;
/cvsroot/mozilla/webtools/bugzilla/email_in.pl,v  <--  email_in.pl
new revision: 1.5.2.8; previous revision: 1.5.2.7
done

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