Last Comment Bug 534587 - Bugmail uses the timezone of the changee instead of the user receiving the mail
: Bugmail uses the timezone of the changee instead of the user receiving the mail
Status: RESOLVED FIXED
:
Product: Bugzilla
Classification: Server Software
Component: Email Notifications (show other bugs)
: 3.4.4
: All All
: -- normal (vote)
: Bugzilla 3.4
Assigned To: Reed Loden [:reed] (use needinfo?)
: default-qa
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-12-14 00:38 PST by Reed Loden [:reed] (use needinfo?)
Modified: 2010-02-28 10:44 PST (History)
6 users (show)
mkanat: approval+
mkanat: approval3.4+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch - v1 (2.23 KB, patch)
2009-12-14 00:38 PST, Reed Loden [:reed] (use needinfo?)
mkanat: review-
Details | Diff | Review
patch - v2 (tip) (3.88 KB, patch)
2009-12-14 18:29 PST, Reed Loden [:reed] (use needinfo?)
mkanat: review+
Details | Diff | Review
patch - v1 (3.4 branch) (3.24 KB, patch)
2009-12-14 19:06 PST, Reed Loden [:reed] (use needinfo?)
mkanat: review+
Details | Diff | Review

Description Reed Loden [:reed] (use needinfo?) 2009-12-14 00:38:50 PST
Created attachment 417436 [details] [diff] [review]
patch - v1

Instead of using the user's chosen timezone for displaying the comment header in bugmail, it seems the changee's timezone is used.

Untested patch attached.
Comment 1 Max Kanat-Alexander 2009-12-14 14:47:39 PST
Comment on attachment 417436 [details] [diff] [review]
patch - v1

This looks basically right. However:

* "undef" doesn't exist in TT, that's just another variable name. It will just pass an empty string, so the thing that needs to be done there is just to pass an empty string and then modify format_time to check $format instead of just "defined $format".

* I think we should just pass the whole $user object as to_user, to the template. I've wanted that many times anyhow.
Comment 2 Reed Loden [:reed] (use needinfo?) 2009-12-14 14:59:09 PST
(In reply to comment #1) 
> * "undef" doesn't exist in TT, that's just another variable name. It will just
> pass an empty string

I wondered about that, but a mxr search for "undef" under template/ returned a few things, so I thought it might work.

http://mxr.mozilla.org/bugzilla/search?string=undef&find=%2Ftemplate&findi=&filter=^[^\0]*%24&hitlimit=&tree=bugzilla

> * I think we should just pass the whole $user object as to_user, to the
> template. I've wanted that many times anyhow.

Ok, can do. New patch coming up in a bit.
Comment 3 Reed Loden [:reed] (use needinfo?) 2009-12-14 18:29:57 PST
Created attachment 417607 [details] [diff] [review]
patch - v2 (tip)

How about this?
Comment 4 Max Kanat-Alexander 2009-12-14 18:57:45 PST
Comment on attachment 417607 [details] [diff] [review]
patch - v2 (tip)

That looks pretty reasonable. I'll test it before checkin.

For the 3.4 branch, we shouldn't take away "to", because that could break somebody's custom email template.
Comment 5 Max Kanat-Alexander 2009-12-14 18:58:08 PST
(Another patch for 3.4 that doesn't remove "to" would help out with the checkin process.)
Comment 6 Reed Loden [:reed] (use needinfo?) 2009-12-14 19:06:12 PST
Created attachment 417608 [details] [diff] [review]
patch - v1 (3.4 branch)
Comment 7 Reed Loden [:reed] (use needinfo?) 2010-01-04 23:08:15 PST
tip:

Checking in Bugzilla/BugMail.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm,v  <--  BugMail.pm
new revision: 1.132; previous revision: 1.131
done
Checking in Bugzilla/Util.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Util.pm,v  <--  Util.pm
new revision: 1.100; previous revision: 1.99
done
Checking in template/en/default/email/newchangedmail.txt.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/email/newchangedmail.txt.tmpl,v  <--  newchangedmail.txt.tmpl
new revision: 1.18; previous revision: 1.17
done

BUGZILLA-3_4-BRANCH:

Checking in Bugzilla/BugMail.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm,v  <--  BugMail.pm
new revision: 1.124.2.6; previous revision: 1.124.2.5
done
Checking in Bugzilla/Util.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Util.pm,v  <--  Util.pm
new revision: 1.86.2.5; previous revision: 1.86.2.4
done
Checking in template/en/default/email/newchangedmail.txt.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/email/newchangedmail.txt.tmpl,v  <--  newchangedmail.txt.tmpl
new revision: 1.12.2.5; previous revision: 1.12.2.4
done

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