TypeError: aEvent.target is undefined when calling openUILink(kSupportUri, {});

RESOLVED FIXED in 4.4

Status

Calendar
Lightning: SeaMonkey Integration
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: Philip Chee, Assigned: Philip Chee)

Tracking

unspecified

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

2 years ago
Error: TypeError: aEvent.target is undefined
Source file: chrome://communicator/content/utilityOverlay.js
Line: 1418

http://mxr.mozilla.org/comm-central/source/calendar/lightning/content/messenger-overlay-sidebar.js?rev=3fe65676c36b#238

236     // call backs for the opt-out bar
237     let cbLearnMore = function(aNotificationBar, aButton) {
238         openUILink(kSupportUri, {});
239         return true;
240     };

SeaMonkey (and Firefox) expect that the second parameter is a real event or null.
(Assignee)

Comment 1

2 years ago
Created attachment 8637422 [details] [diff] [review]
Patch v1.0 proposed fix.

Alternatives:
openUILink(kSupportUri, { button: 0, target: { ownerDocument: document } });
openUILink(kSupportUri, openUILink.length < 3 ? {} : null);
Assignee: nobody → philip.chee
Status: NEW → ASSIGNED
Attachment #8637422 - Flags: review?(philipp)
Comment on attachment 8637422 [details] [diff] [review]
Patch v1.0 proposed fix.

Review of attachment 8637422 [details] [diff] [review]:
-----------------------------------------------------------------

What release do you need this for?

r=philipp with this nit:

::: calendar/lightning/content/messenger-overlay-sidebar.js
@@ +239,5 @@
> +        // In Thunderbird the number of formal parameters is 2.
> +        if (openUILink.length < 3)
> +          openUILink(kSupportUri, { button: 0 });
> +        else
> +          openUILink(kSupportUri); // SeaMonkey

I think it would be better to differ using xul app info, or just initiate a real Event and pass that unconditionally.

If you go for the first solution, brackets even for one-line ifs.
Attachment #8637422 - Flags: review?(philipp) → review+
(In reply to Philip Chee from comment #1)
This one is fine with me too:

> openUILink(kSupportUri, { button: 0, target: { ownerDocument: document } });
(Assignee)

Comment 4

2 years ago
Created attachment 8639460 [details] [diff] [review]
Patch v1.1 use event-like object r=Fallen Patch as checked-in

Pushed to comm-central:
http://hg.mozilla.org/comm-central/rev/4edff7a7b2fa
Attachment #8637422 - Attachment is obsolete: true
Attachment #8639460 - Flags: review+
(Assignee)

Updated

2 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 4.2
Target Milestone: 4.2 → 4.4
You need to log in before you can comment on or make changes to this bug.