Closed Bug 405946 Opened 17 years ago Closed 16 years ago

Some emails are not sent in the language chosen by the addressee

Categories

(Bugzilla :: Email Notifications, defect, P2)

3.0.2
defect

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: mail.mht, Assigned: LpSolit)

References

Details

Attachments

(10 files, 2 obsolete files)

937 bytes, patch
Wurblzap
: review+
Details | Diff | Splinter Review
1.06 KB, patch
Wurblzap
: review+
Details | Diff | Splinter Review
13.33 KB, patch
Wurblzap
: review+
Details | Diff | Splinter Review
3.86 KB, patch
LpSolit
: review+
Details | Diff | Splinter Review
5.49 KB, patch
Wurblzap
: review+
Details | Diff | Splinter Review
828 bytes, patch
Wurblzap
: review+
Details | Diff | Splinter Review
903 bytes, patch
Wurblzap
: review+
Details | Diff | Splinter Review
6.99 KB, patch
LpSolit
: review+
Details | Diff | Splinter Review
7.04 KB, patch
Wurblzap
: review+
Details | Diff | Splinter Review
12.52 KB, patch
Wurblzap
: review+
Details | Diff | Splinter Review
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.
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.
Assignee: whining → LpSolit
Status: UNCONFIRMED → NEW
Component: Whining → Email Notifications
Ever confirmed: true
OS: Windows XP → All
Priority: -- → P2
Hardware: PC → All
Target Milestone: --- → Bugzilla 3.0
Version: unspecified → 3.0.2
Summary: whine.txt.tmpl - email template in custom folder will not be used → Some emails are not sent in the language chosen by the addressee
Marking as blocking 3.2 as that's really something I want to see fixed before the next release.
Status: NEW → ASSIGNED
Flags: blocking3.2+
Attached patch WIP, v0.3 (obsolete) — Splinter Review
Not complete yet.
Depends on: 413183
No longer depends on: 413183
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.
Attachment #295996 - Attachment is obsolete: true
Attachment #310381 - Flags: review?(wurblzap)
Attachment #310381 - Flags: review?(justdave)
Attachment #310387 - Flags: review?(wurblzap)
Attachment #310387 - Flags: review?(justdave)
RemoveVotes() required more work as it's being called by both process_bug.cgi and editproducts.cgi.
Attachment #310403 - Flags: review?(wurblzap)
Attachment #310403 - Flags: review?(justdave)
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.
Attachment #310403 - Flags: review?(wurblzap)
Attachment #310557 - Flags: review?(wurblzap)
Attachment #310557 - Flags: review?(justdave)
Comment on attachment 310381 [details] [diff] [review]
patch for relogin.cgi (sudo sessions) (both 3.0 and tip), v1

r=Wurblzap by inspection.
Attachment #310381 - Flags: review?(wurblzap) → review+
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.
Attachment #310387 - Flags: review?(wurblzap) → review+
Attachment #310381 - Flags: review?(justdave)
Attachment #310387 - Flags: review?(justdave)
a=me for everything which has a r+.
Flags: approval3.0+
Flags: approval+
Only affects Flag.pm, granting review as module owner.
Attachment #310662 - Flags: review+
Same changes in Flag::notify() compared to the patch for tip, but 3.0 still requires tables to be LOCK'ed first.
Attachment #310664 - Flags: review?(wurblzap)
Attachment #310664 - Flags: review?(justdave)
Attachment #310667 - Flags: review?(wurblzap)
Attachment #310667 - Flags: review?(justdave)
That's the last patch for tip. All affected scripts have been fixed.
Attachment #310675 - Flags: review?(wurblzap)
Attachment #310675 - Flags: review?(justdave)
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.
Attachment #310667 - Flags: review?(wurblzap) → review+
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.
Attachment #310675 - Flags: review?(wurblzap) → review+
Attachment #310667 - Flags: review?(justdave)
Attachment #310675 - Flags: review?(justdave)
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.
Attachment #310557 - Flags: review?(wurblzap) → review+
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).
Attachment #310664 - Flags: review?(wurblzap) → review+
Attachment #310557 - Flags: review?(justdave)
Attachment #310664 - Flags: review?(justdave)
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.
Attachment #310403 - Flags: review+
Blocks: 244204
Addressing Marc's comment. Carrying forward Marc's r+.
Attachment #310403 - Attachment is obsolete: true
Attachment #313081 - Flags: review+
Attachment #310403 - Flags: review?(justdave)
Backport for 3.0.4. No changes besides process_bug.cgi, which uses $id instead of $bug->id. Tested, works.
Attachment #313086 - Flags: review?(wurblzap)
This is the final patch, backports included. :)
Attachment #313089 - Flags: review?(wurblzap)
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.
Attachment #313086 - Flags: review?(wurblzap) → review+
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.
Attachment #313089 - Flags: review?(wurblzap) → review+
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
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: relnote
Resolution: --- → FIXED
relnoted for 3.0.x, no 3.2 relnote needed.
Keywords: relnote
You need to log in before you can comment on or make changes to this bug.