Last Comment Bug 405946 - Some emails are not sent in the language chosen by the addressee
: Some emails are not sent in the language chosen by the addressee
Status: RESOLVED FIXED
:
Product: Bugzilla
Classification: Server Software
Component: Email Notifications (show other bugs)
: 3.0.2
: All All
: P2 normal (vote)
: Bugzilla 3.0
Assigned To: Frédéric Buclin
: default-qa
:
Mentors:
Depends on:
Blocks: 244204
  Show dependency treegraph
 
Reported: 2007-11-29 00:23 PST by Mathias Heppert
Modified: 2008-06-30 23:55 PDT (History)
4 users (show)
LpSolit: approval+
LpSolit: blocking3.2+
LpSolit: approval3.0+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
WIP, v0.3 (9.40 KB, patch)
2008-01-08 12:31 PST, Frédéric Buclin
no flags Details | Diff | Splinter Review
patch for relogin.cgi (sudo sessions) (both 3.0 and tip), v1 (937 bytes, patch)
2008-03-18 17:36 PDT, Frédéric Buclin
wurblzap: review+
Details | Diff | Splinter Review
patch for whine.pl (both 3.0 and tip), v1 (1.06 KB, patch)
2008-03-18 18:08 PDT, Frédéric Buclin
wurblzap: review+
Details | Diff | Splinter Review
patch for RemoveVotes(), including process_bug.cgi and editproducts.cgi (tip only), v1 (7.92 KB, patch)
2008-03-18 19:26 PDT, Frédéric Buclin
wurblzap: review+
Details | Diff | Splinter Review
patch for token.cgi and Token.pm (tip only), v1 (13.33 KB, patch)
2008-03-19 13:40 PDT, Frédéric Buclin
wurblzap: review+
Details | Diff | Splinter Review
patch for Flag::notify() (tip only), v1 (3.86 KB, patch)
2008-03-19 18:37 PDT, Frédéric Buclin
LpSolit: review+
Details | Diff | Splinter Review
patch for Flag::notify() (3.0 only), v1 (5.49 KB, patch)
2008-03-19 18:52 PDT, Frédéric Buclin
wurblzap: review+
Details | Diff | Splinter Review
patch for whineatnews.pl (both 3.0 and tip), v1 (828 bytes, patch)
2008-03-19 19:27 PDT, Frédéric Buclin
wurblzap: review+
Details | Diff | Splinter Review
patch for sanitycheck.cgi (tip only), v1 (903 bytes, patch)
2008-03-19 21:13 PDT, Frédéric Buclin
wurblzap: review+
Details | Diff | Splinter Review
patch for RemoveVotes(), including process_bug.cgi and editproducts.cgi (tip only), v2 (6.99 KB, patch)
2008-04-02 06:53 PDT, Frédéric Buclin
LpSolit: review+
Details | Diff | Splinter Review
patch for RemoveVotes(), including process_bug.cgi and editproducts.cgi (3.0 only), v1 (7.04 KB, patch)
2008-04-02 07:21 PDT, Frédéric Buclin
wurblzap: review+
Details | Diff | Splinter Review
patch for token.cgi and Token.pm (3.0 only), v1 (12.52 KB, patch)
2008-04-02 07:59 PDT, Frédéric Buclin
wurblzap: review+
Details | Diff | Splinter Review

Description Mathias Heppert 2007-11-29 00:23:42 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.10) Gecko/20071115 Firefox/2.0.0.10
Build Identifier: 3.0.2

I use Bugzilla Version 3.0.2 with Germzilla Version 3.0.2-1.

I have modify the template whine.txt.tmpl in the following subdirectory:

...bugzilla\template\de\custom\email\

but this template isn't used in sent emails. The email language is "de" or "administrator default (de)" for the user "assigned_to".

Here is the code from whineatnews.pl where I think is the problem:

my $msg;
    my $template = Bugzilla->template;
    $template->process("email/whine.txt.tmpl", $vars, \$msg);



Reproducible: Always

Steps to Reproduce:
1.Modify whine.txt.tmpl in ...bugzilla\template\de\custom\email\
2.run checksetup.pl
3.start task for whining so that emails were sent
Actual Results:  
The users get always an English email.

Expected Results:  
The users should get an email in the language which is set for the user in email language in personal configuration.
Comment 1 Frédéric Buclin 2007-11-29 12:26:35 PST
I can reproduce as well. The problem is that emails should be sent using Bugzilla->template_inner instead of Bugzilla->template. whineatnews.pl is affected, but also sanitycheck.pl and probably some other scripts. I will fix them all.
Comment 2 Frédéric Buclin 2007-12-21 13:28:24 PST
Marking as blocking 3.2 as that's really something I want to see fixed before the next release.
Comment 3 Frédéric Buclin 2008-01-08 12:31:18 PST
Created attachment 295996 [details] [diff] [review]
WIP, v0.3

Not complete yet.
Comment 4 Frédéric Buclin 2008-03-18 17:36:52 PDT
Created attachment 310381 [details] [diff] [review]
patch for relogin.cgi (sudo sessions) (both 3.0 and tip), v1

Let's do it in small pieces... First one: relogin.cgi. Tested on both 3.0.4 and 3.1.4 with english, french and belarus templates installed.
Comment 5 Frédéric Buclin 2008-03-18 18:08:51 PDT
Created attachment 310387 [details] [diff] [review]
patch for whine.pl (both 3.0 and tip), v1
Comment 6 Frédéric Buclin 2008-03-18 19:26:10 PDT
Created attachment 310403 [details] [diff] [review]
patch for RemoveVotes(), including process_bug.cgi and editproducts.cgi (tip only), v1

RemoveVotes() required more work as it's being called by both process_bug.cgi and editproducts.cgi.
Comment 7 Marc Schumann [:Wurblzap] 2008-03-19 12:37:03 PDT
Comment on attachment 310403 [details] [diff] [review]
patch for RemoveVotes(), including process_bug.cgi and editproducts.cgi (tip only), v1

Clearing r? -- I don't think I'll look into the voting feature again any time soon. Please ask again if it's sufficient for me to simply rubber-stamp the patch.
Comment 8 Frédéric Buclin 2008-03-19 13:40:19 PDT
Created attachment 310557 [details] [diff] [review]
patch for token.cgi and Token.pm (tip only), v1
Comment 9 Marc Schumann [:Wurblzap] 2008-03-19 16:44:16 PDT
Comment on attachment 310381 [details] [diff] [review]
patch for relogin.cgi (sudo sessions) (both 3.0 and tip), v1

r=Wurblzap by inspection.
Comment 10 Marc Schumann [:Wurblzap] 2008-03-19 16:46:54 PDT
Comment on attachment 310387 [details] [diff] [review]
patch for whine.pl (both 3.0 and tip), v1

r=Wurblzap by inspection. Good thing to catch the nomail comment, too.
Comment 11 Frédéric Buclin 2008-03-19 16:52:19 PDT
a=me for everything which has a r+.
Comment 12 Frédéric Buclin 2008-03-19 18:37:01 PDT
Created attachment 310662 [details] [diff] [review]
patch for Flag::notify() (tip only), v1

Only affects Flag.pm, granting review as module owner.
Comment 13 Frédéric Buclin 2008-03-19 18:52:59 PDT
Created attachment 310664 [details] [diff] [review]
patch for Flag::notify() (3.0 only), v1

Same changes in Flag::notify() compared to the patch for tip, but 3.0 still requires tables to be LOCK'ed first.
Comment 14 Frédéric Buclin 2008-03-19 19:27:28 PDT
Created attachment 310667 [details] [diff] [review]
patch for whineatnews.pl (both 3.0 and tip), v1
Comment 15 Frédéric Buclin 2008-03-19 21:13:23 PDT
Created attachment 310675 [details] [diff] [review]
patch for sanitycheck.cgi (tip only), v1

That's the last patch for tip. All affected scripts have been fixed.
Comment 16 Marc Schumann [:Wurblzap] 2008-03-25 14:31:45 PDT
Comment on attachment 310667 [details] [diff] [review]
patch for whineatnews.pl (both 3.0 and tip), v1

r=Wurblzap by inspection. This patch follows the lead of the previous ones.
Comment 17 Marc Schumann [:Wurblzap] 2008-03-25 14:31:57 PDT
Comment on attachment 310675 [details] [diff] [review]
patch for sanitycheck.cgi (tip only), v1

r=Wurblzap by inspection. Same for this: this patch follows the lead of the previous ones.
Comment 18 Marc Schumann [:Wurblzap] 2008-03-28 06:16:57 PDT
Comment on attachment 310557 [details] [diff] [review]
patch for token.cgi and Token.pm (tip only), v1

r=Wurblzap by inspection. Was a lot more straightforward than I initially thought after all.
Comment 19 Marc Schumann [:Wurblzap] 2008-03-28 07:03:01 PDT
Comment on attachment 310664 [details] [diff] [review]
patch for Flag::notify() (3.0 only), v1

>Index: Bugzilla/Flag.pm
>===================================================================
>RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Flag.pm,v
>retrieving revision 1.83.2.2
>diff -3 -p -u -r1.83.2.2 Flag.pm
>--- Bugzilla/Flag.pm	8 Aug 2007 01:53:37 -0000	1.83.2.2
>+++ Bugzilla/Flag.pm	20 Mar 2008 01:50:50 -0000
>@@ -1017,56 +1017,54 @@ or deleted.
>+    foreach my $cc (split(/[, ]+/, $flag->type->cc_list)) {
>+        my $ccuser = new Bugzilla::User({ name => $cc });
>+        next if (scalar(@bug_in_groups) && (!$ccuser || !$ccuser->can_see_bug($bug->bug_id)));
>+        next if $attachment_is_private && (!$ccuser || !$ccuser->is_insider);
>+        # Prevent duplicated entries due to case sensitivity.
>+        $cc = $ccuser ? $ccuser->email : $cc;

I'm not happy with this comment, because I don't understand at first sight what's going on. r=Wurblzap by inspection anyway, but please consider re-wording this with a couple more words here before check-in (this applies to the tip patch, too).
Comment 20 Marc Schumann [:Wurblzap] 2008-03-28 07:14:24 PDT
Comment on attachment 310403 [details] [diff] [review]
patch for RemoveVotes(), including process_bug.cgi and editproducts.cgi (tip only), v1

r=Wurblzap by inspection on a slightly modified patch: the technical reason strings (votes_bug_moved and so on) should be put into $vars directly, and the strings in messages.html.tmpl should be put into an [% IF %] construct in votes-removed.txt.tmpl instead of messages.html.tmpl. Please carry forward r+ to an updated patch.
Comment 21 Frédéric Buclin 2008-04-02 06:53:40 PDT
Created attachment 313081 [details] [diff] [review]
patch for RemoveVotes(), including process_bug.cgi and editproducts.cgi (tip only), v2

Addressing Marc's comment. Carrying forward Marc's r+.
Comment 22 Frédéric Buclin 2008-04-02 07:21:35 PDT
Created attachment 313086 [details] [diff] [review]
patch for RemoveVotes(), including process_bug.cgi and editproducts.cgi (3.0 only), v1

Backport for 3.0.4. No changes besides process_bug.cgi, which uses $id instead of $bug->id. Tested, works.
Comment 23 Frédéric Buclin 2008-04-02 07:59:07 PDT
Created attachment 313089 [details] [diff] [review]
patch for token.cgi and Token.pm (3.0 only), v1

This is the final patch, backports included. :)
Comment 24 Marc Schumann [:Wurblzap] 2008-04-02 08:54:13 PDT
Comment on attachment 313086 [details] [diff] [review]
patch for RemoveVotes(), including process_bug.cgi and editproducts.cgi (3.0 only), v1

r=Wurblzap by inspection, assuming you tested.
Comment 25 Marc Schumann [:Wurblzap] 2008-04-02 08:57:07 PDT
Comment on attachment 313089 [details] [diff] [review]
patch for token.cgi and Token.pm (3.0 only), v1

r=Wurblzap by inspection, assuming you tested.
Comment 26 Frédéric Buclin 2008-04-02 10:47:24 PDT
tip:

Checking in editproducts.cgi;
/cvsroot/mozilla/webtools/bugzilla/editproducts.cgi,v  <--  editproducts.cgi
new revision: 1.141; previous revision: 1.140
done
Checking in process_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/process_bug.cgi,v  <--  process_bug.cgi
new revision: 1.409; previous revision: 1.408
done
Checking in relogin.cgi;
/cvsroot/mozilla/webtools/bugzilla/relogin.cgi,v  <--  relogin.cgi
new revision: 1.41; previous revision: 1.40
done
Checking in sanitycheck.cgi;
/cvsroot/mozilla/webtools/bugzilla/sanitycheck.cgi,v  <--  sanitycheck.cgi
new revision: 1.139; previous revision: 1.138
done
Checking in token.cgi;
/cvsroot/mozilla/webtools/bugzilla/token.cgi,v  <--  token.cgi
new revision: 1.54; previous revision: 1.53
done
Checking in userprefs.cgi;
/cvsroot/mozilla/webtools/bugzilla/userprefs.cgi,v  <--  userprefs.cgi
new revision: 1.120; previous revision: 1.119
done
Checking in whine.pl;
/cvsroot/mozilla/webtools/bugzilla/whine.pl,v  <--  whine.pl
new revision: 1.37; previous revision: 1.36
done
Checking in whineatnews.pl;
/cvsroot/mozilla/webtools/bugzilla/whineatnews.pl,v  <--  whineatnews.pl
new revision: 1.31; previous revision: 1.30
done
Checking in Bugzilla/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v  <--  Bug.pm
new revision: 1.239; previous revision: 1.238
done
Checking in Bugzilla/Flag.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Flag.pm,v  <--  Flag.pm
new revision: 1.94; previous revision: 1.93
done
Checking in Bugzilla/Token.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Token.pm,v  <--  Token.pm
new revision: 1.55; previous revision: 1.54
done
Checking in template/en/default/account/cancel-token.txt.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/account/cancel-token.txt.tmpl,v  <--  cancel-token.txt.tmpl
new revision: 1.15; previous revision: 1.14
done
Checking in template/en/default/email/votes-removed.txt.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/email/votes-removed.txt.tmpl,v  <--  votes-removed.txt.tmpl
new revision: 1.5; previous revision: 1.4
done
Checking in template/en/default/global/user-error.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl,v  <--  user-error.html.tmpl
new revision: 1.248; previous revision: 1.247
done


3.0.3:

Checking in attachment.cgi;
/cvsroot/mozilla/webtools/bugzilla/attachment.cgi,v  <--  attachment.cgi
new revision: 1.126.2.1; previous revision: 1.126
done
Checking in editproducts.cgi;
/cvsroot/mozilla/webtools/bugzilla/editproducts.cgi,v  <--  editproducts.cgi
new revision: 1.132.2.3; previous revision: 1.132.2.2
done
Checking in process_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/process_bug.cgi,v  <--  process_bug.cgi
new revision: 1.351.2.10; previous revision: 1.351.2.9
done
Checking in relogin.cgi;
/cvsroot/mozilla/webtools/bugzilla/relogin.cgi,v  <--  relogin.cgi
new revision: 1.39.2.1; previous revision: 1.39
done
Checking in token.cgi;
/cvsroot/mozilla/webtools/bugzilla/token.cgi,v  <--  token.cgi
new revision: 1.48.2.1; previous revision: 1.48
done
Checking in userprefs.cgi;
/cvsroot/mozilla/webtools/bugzilla/userprefs.cgi,v  <--  userprefs.cgi
new revision: 1.112.2.4; previous revision: 1.112.2.3
done
Checking in whine.pl;
/cvsroot/mozilla/webtools/bugzilla/whine.pl,v  <--  whine.pl
new revision: 1.32.2.1; previous revision: 1.32
done
Checking in whineatnews.pl;
/cvsroot/mozilla/webtools/bugzilla/whineatnews.pl,v  <--  whineatnews.pl
new revision: 1.27.2.3; previous revision: 1.27.2.2
done
Checking in Bugzilla/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v  <--  Bug.pm
new revision: 1.171.2.6; previous revision: 1.171.2.5
done
Checking in Bugzilla/Flag.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Flag.pm,v  <--  Flag.pm
new revision: 1.83.2.3; previous revision: 1.83.2.2
done
Checking in Bugzilla/Token.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Token.pm,v  <--  Token.pm
new revision: 1.52.2.2; previous revision: 1.52.2.1
done
Checking in template/en/default/account/cancel-token.txt.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/account/cancel-token.txt.tmpl,v  <--  cancel-token.txt.tmpl
new revision: 1.11.2.2; previous revision: 1.11.2.1
done
Checking in template/en/default/email/votes-removed.txt.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/email/votes-removed.txt.tmpl,v  <--  votes-removed.txt.tmpl
new revision: 1.2.2.1; previous revision: 1.2
done
Comment 27 Max Kanat-Alexander 2008-06-30 23:55:07 PDT
relnoted for 3.0.x, no 3.2 relnote needed.

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