Last Comment Bug 1186579 - TypeError: aEvent.target is undefined when calling openUILink(kSupportUri, {});
: TypeError: aEvent.target is undefined when calling openUILink(kSupportUri, {});
Status: RESOLVED FIXED
:
Product: Calendar
Classification: Client Software
Component: Lightning: SeaMonkey Integration (show other bugs)
: unspecified
: Unspecified Unspecified
-- normal (vote)
: 4.4
Assigned To: Philip Chee
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-22 12:45 PDT by Philip Chee
Modified: 2015-07-27 15:56 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Patch v1.0 proposed fix. (1.40 KB, patch)
2015-07-22 13:10 PDT, Philip Chee
philipp: review+
Details | Diff | Splinter Review
Patch v1.1 use event-like object r=Fallen Patch as checked-in (1.58 KB, patch)
2015-07-27 12:46 PDT, Philip Chee
philip.chee: review+
Details | Diff | Splinter Review

Description User image Philip Chee 2015-07-22 12:45:09 PDT
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.
Comment 1 User image Philip Chee 2015-07-22 13:10:15 PDT
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);
Comment 2 User image Philipp Kewisch [:Fallen] 2015-07-22 14:56:25 PDT
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.
Comment 3 User image Philipp Kewisch [:Fallen] 2015-07-22 14:57:19 PDT
(In reply to Philip Chee from comment #1)
This one is fine with me too:

> openUILink(kSupportUri, { button: 0, target: { ownerDocument: document } });
Comment 4 User image Philip Chee 2015-07-27 12:46:28 PDT
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

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