Last Comment Bug 583622 - email_in.pl doesn't let me set timetracking fields
: email_in.pl doesn't let me set timetracking fields
Status: RESOLVED FIXED
: dataloss
Product: Bugzilla
Classification: Server Software
Component: Incoming Email (show other bugs)
: 4.1
: All All
: -- normal (vote)
: Bugzilla 3.6
Assigned To: Frédéric Buclin
: default-qa
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-01 13:04 PDT by Frédéric Buclin
Modified: 2010-08-01 18:38 PDT (History)
1 user (show)
mkanat: approval+
mkanat: approval4.0+
mkanat: blocking4.0+
mkanat: approval3.6+
mkanat: blocking3.6.2+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch, v1 (1.71 KB, patch)
2010-08-01 17:00 PDT, Frédéric Buclin
no flags Details | Diff | Splinter Review
patch, v2 (1.40 KB, patch)
2010-08-01 18:25 PDT, Frédéric Buclin
mkanat: review+
Details | Diff | Splinter Review

Description Frédéric Buclin 2010-08-01 13:04:53 PDT
email_in.pl calls Bugzilla::Bug::map_fields() from parse_mail() before calling Bugzilla->set_user(), so all timetracking fields are deleted by map_fields() because at this point, the Bugzilla->user object is not set yet:

    unless (Bugzilla->user->is_timetracker) {
        delete @field_values{qw(estimated_time remaining_time deadline)};
    }

Bugzilla->set_user() should be called before calling map_fields().
Comment 1 Frédéric Buclin 2010-08-01 17:00:16 PDT
Created attachment 461962 [details] [diff] [review]
patch, v1
Comment 2 Frédéric Buclin 2010-08-01 18:25:39 PDT
Created attachment 461968 [details] [diff] [review]
patch, v2

map_fields() is only called by email_in.pl and Bug.search, Bug.create and Bug.update. When creating or updating a bug, validators already make sure the user is in the timetracking group. So the only place which needs to remove time-related fields is Bug.search.
Comment 3 Max Kanat-Alexander 2010-08-01 18:26:44 PDT
Comment on attachment 461968 [details] [diff] [review]
patch, v2

This is generally simpler...seems like we should just take this on all the branches, no?
Comment 4 Max Kanat-Alexander 2010-08-01 18:31:18 PDT
Comment on attachment 461962 [details] [diff] [review]
patch, v1

Okay, let's just take the simple one on the branches, too.
Comment 5 Frédéric Buclin 2010-08-01 18:38:38 PDT
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Bug.pm
modified Bugzilla/WebService/Bug.pm
Committed revision 7416.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.0/
modified Bugzilla/Bug.pm
modified Bugzilla/WebService/Bug.pm
Committed revision 7359.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/3.6/
modified Bugzilla/Bug.pm
modified Bugzilla/WebService/Bug.pm
Committed revision 7152.

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