Cannot print mailing list - "Uncaught TypeError: card.translateTo is not a function"
Categories
(Thunderbird :: Address Book, defect)
Tracking
(thunderbird_esr78 fixed)
| Tracking | Status | |
|---|---|---|
| thunderbird_esr78 | --- | fixed |
People
(Reporter: cmgaudry33, Assigned: cmgaudry33)
References
(Regression)
Details
(Keywords: regression, regressionwindow-wanted)
Attachments
(5 files, 2 obsolete files)
|
4.66 KB,
image/png
|
Details | |
|
2.12 KB,
patch
|
darktrojan
:
feedback+
|
Details | Diff | Splinter Review |
|
6.35 KB,
image/png
|
Details | |
|
2.07 KB,
patch
|
darktrojan
:
review+
wsmwk
:
approval-comm-beta-
|
Details | Diff | Splinter Review |
|
2.04 KB,
patch
|
darktrojan
:
review+
wsmwk
:
approval-comm-esr78+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36
Steps to reproduce:
- Display Address books window
- Create a new directory
- Create a new mailing list in this address book
- Right click on this mailing list
- Click on Print menu
- Display the console
Actual results:
No mailing list printing but the following exception is thrown :
Uncaught TypeError: card.translateTo is not a function
CreatePrintCardUrl chrome://messenger/content/addressbook/addressbook.js:489
AbPrintCardInternal chrome://messenger/content/addressbook/addressbook.js:462
AbPrintCard chrome://messenger/content/addressbook/addressbook.js:481
oncommand chrome://messenger/content/addressbook/addressbook.xhtml:1
Expected results:
No exception and no printing because a mailing list cannot be convert to XML data for now.
| Assignee | ||
Comment 1•5 years ago
|
||
Avoid mailing list printing because it cannot be printed
Comment 2•5 years ago
|
||
confirming for 84.0a1 (2020-11-09) (64-bit)
Comment 3•5 years ago
|
||
Printing mailing list was working pretty well in TB 68. (regression)
Let's first find out what broke this.
Comment 4•5 years ago
|
||
Comment 5•5 years ago
|
||
Updated•5 years ago
|
| Assignee | ||
Comment 6•5 years ago
|
||
I think the AddrBookDirectory class breaks some things, including its asCard method.
So a mailing list is no longer really usable as a nsIAbCard.
Anyway, on my side, I can overcome the problem by implementing a translateTo method on the nsIAbCard object returned by the AddrBookDirectory.asCard method, to manage the xml and base64xml type conversions. For the vcard type, it seems more complicated to me.
| Assignee | ||
Comment 7•5 years ago
|
||
I was talking about AddrBookMailingList (not AddrBookDirectory ;-)
| Assignee | ||
Comment 8•5 years ago
|
||
You just have to implement some function into the nsIAbCard returned by the AddrBookMailingList.asCard method.
A new patch is following.
| Assignee | ||
Comment 9•5 years ago
|
||
- Restore the mail list printing feature.
- Fix Bug 1676128 also.
| Assignee | ||
Comment 10•5 years ago
|
||
For your information, this new translateTo method will return the same output that it is in Thunderbird 68.9.0.
To do so it is needed to manage some special entries in the new properties method.
Have a nice day !
| Assignee | ||
Comment 11•5 years ago
|
||
This patch can be applied to the daily release.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 12•5 years ago
•
|
||
f?mkmelin to comment if this is the right approach code-wise, in general (note that the patch currently fails).
Screenshot of Print Preview Contact with patch attachment 9186945 [details] [diff] [review] applied.
This is probably an improvement, but:
- Print still fails with errors.
- The print layout does not have a bolded title (as in TB 68, see screenshot attachment 9186806 [details]), which looks especially relevant for mailing lists.
Console Errors with patch applied:
[fluent] Missing translations in en-US: progress. Localization.jsm:202:13
Uncaught (in promise) undefined
Uncaught TypeError: can't access property 0, window.arguments is undefined
loadRequestedUrl chrome://messenger/content/extensionPopup.js:53
onload chrome://messenger/content/extensionPopup.xhtml:1
extensionPopup.js:53:7
[fluent] Missing translations in en-US: progress. Localization.jsm:202:13
Uncaught (in promise) undefined
Without the patch, it fails with:
Uncaught TypeError: card.translateTo is not a function
CreatePrintCardUrl chrome://messenger/content/addressbook/addressbook.js:418
AbPrintCardInternal chrome://messenger/content/addressbook/addressbook.js:391
AbPrintCard chrome://messenger/content/addressbook/addressbook.js:410
oncommand chrome://messenger/content/addressbook/addressbook.xhtml:1
addressbook.js:418:48
Comment 13•5 years ago
|
||
Magnus, is it only the Fluent error which makes this fail?
Updated•5 years ago
|
Updated•5 years ago
|
Comment 14•5 years ago
|
||
Comment on attachment 9186945 [details] [diff] [review]
bug_1676166.diff
This is fine except that for trunk, generateQI now has string arguments. And for some reason the end of translateTo differs from the same function in AddrBookCard.
Updated•5 years ago
|
Comment 15•5 years ago
|
||
FWIW I don't know why printing on trunk is broken. Calendar is also affected but printing messages is not.
| Assignee | ||
Comment 16•5 years ago
|
||
Patch updated to take into account the signature of the ChromeUtils.generateQI method.
This patch can be applied to the trunk.
Comment 17•5 years ago
|
||
| Assignee | ||
Comment 18•5 years ago
|
||
Not in 78.5.1 but it should be fixed in 78 branch too.
Comment 19•5 years ago
|
||
Comment on attachment 9190499 [details] [diff] [review]
bug_1676166_trunk.diff
[Approval Request Comment]
Regression caused by (bug #): bug 1572324
User impact if declined: Printing a mailing list doesn't work
Testing completed (on c-c, etc.): Landing now
Risk to taking this patch (and alternatives if risky): Not risky
Comment 20•5 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/6ec072801722
Fix "Uncaught TypeError: card.translateTo is not a function" exception while printing mailing list. r=darktrojan
Comment 21•5 years ago
|
||
Thanks Chris. FYI, the r= part of the commit message is the reviewer, not you! You can leave that part out altogether when submitting patches and we'll add it when landing.
Comment 22•5 years ago
|
||
Comment on attachment 9190499 [details] [diff] [review]
bug_1676166_trunk.diff
[Triage Comment]
We didn't do another beta, so no beta uplift - this will be in beta 85
| Assignee | ||
Comment 23•5 years ago
|
||
[Approval Request Comment]
Regression caused by (bug #):
User impact if declined: no mailing list printing
Testing completed (on c-c, etc.): tested on modified 78.6.0 release
Risk to taking this patch (and alternatives if risky): not risky
Updated•5 years ago
|
Updated•5 years ago
|
Comment 24•5 years ago
|
||
Comment on attachment 9193284 [details] [diff] [review]
bug_1676166_esr78.diff
[Triage Comment]
Approved for esr78
Comment 25•5 years ago
|
||
Uplift note: The provided esr78 version is corrupt somehow: abort: bad hunk #1: incomplete hunk. Patch was applied by mangling the trunk version with the generateQI calls from the esr78 version.
Comment 26•5 years ago
|
||
| bugherder uplift | ||
Thunderbird 78.6.1:
https://hg.mozilla.org/releases/comm-esr78/rev/90a517293006
Comment 27•5 years ago
|
||
| bugherder uplift | ||
Thunderbird 78.6.1:
https://hg.mozilla.org/releases/comm-esr78/rev/c7f7ca84ec7c
Description
•