Last Comment Bug 713671 - addressingWidgetOverlay.js uses non-existent gPromptService
: addressingWidgetOverlay.js uses non-existent gPromptService
Status: RESOLVED FIXED
: regression
Product: SeaMonkey
Classification: Client Software
Component: MailNews: General (show other bugs)
: Trunk
: All All
: -- normal (vote)
: seamonkey2.9
Assigned To: Philip Chee
:
Mentors:
Depends on: 671554 765175
Blocks: 664838
  Show dependency treegraph
 
Reported: 2011-12-27 09:37 PST by Philip Chee
Modified: 2012-06-15 03:17 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
fixed
fixed


Attachments
Patch v1.0 Proposed Fix. (1.75 KB, patch)
2011-12-27 10:11 PST, Philip Chee
iann_bugzilla: review+
Details | Diff | Splinter Review
Patch Bv1.0 Minimal Branch Patch. (1.39 KB, patch)
2011-12-27 10:21 PST, Philip Chee
neil: review+
iann_bugzilla: approval‑comm‑aurora+
iann_bugzilla: approval‑comm‑beta+
Details | Diff | Splinter Review

Description Philip Chee 2011-12-27 09:37:51 PST
> +++ This bug was initially created as a clone of Bug #671554 +++

> We import Services.jsm but we need to make better use of prompt provided by
>  it.
> This patch:
> * Switches suite code to use prompt provided by Services.jsm
> * Done some minor code simplification.
IanN missed usage of gPromptService in addressingWidgetOverlay.js:
http://mxr.mozilla.org/comm-central/search?string=gpromptservice&find=%2Fsuite%2Fmailnews%2F&findi=&filter=^[^\0]*%24&hitlimit=&tree=comm-central
Comment 1 Philip Chee 2011-12-27 10:11:33 PST
Created attachment 584451 [details] [diff] [review]
Patch v1.0 Proposed Fix.

> -var test_addresses_sequence = false;
> -
> -try {
> -  if (sPrefs)
> -    test_addresses_sequence = sPrefs.getBoolPref("mail.debug.test_addresses_sequence");
> -}
> -catch (ex) {}
> +var test_addresses_sequence = getPref("mail.debug.test_addresses_sequence");

If getPrefType()returns nsIPrefBranch.PREF_INVALID, getPref() returns null.
And doesn't throw (I think).

> -    gPromptService.alert(window, generalErrString, specificErrString);
> +    Services.prompt.alert(window, generalErrString, specificErrString);

Can't test directly but from code inspection should work. Tested with ExecuteJS:

1. Install ExecuteJS.
2. From the context of the compose window execute:
Services.prompt.alert(window, "General Error", "Specific Error");
Comment 2 Philip Chee 2011-12-27 10:21:26 PST
Created attachment 584453 [details] [diff] [review]
Patch Bv1.0 Minimal Branch Patch.

Requesting approval for comm-aurora and comm-beta because the dependent patch landed in those repositories.
Comment 3 Ian Neal 2011-12-27 16:53:08 PST
(In reply to Philip Chee from comment #0)
> > +++ This bug was initially created as a clone of Bug #671554 +++
> 
> > We import Services.jsm but we need to make better use of prompt provided by
> >  it.
> > This patch:
> > * Switches suite code to use prompt provided by Services.jsm
> > * Done some minor code simplification.
> IanN missed usage of gPromptService in addressingWidgetOverlay.js:
> http://mxr.mozilla.org/comm-central/
> search?string=gpromptservice&find=%2Fsuite%2Fmailnews%2F&findi=&filter=^[^\0]
> *%24&hitlimit=&tree=comm-central

That also gives another file as using gPromptService, addressbook-panel.js
Comment 4 Philip Chee 2011-12-30 06:40:48 PST
> That also gives another file as using gPromptService, addressbook-panel.js
Bug 713563 gPromptService is not defined trying to add empty contact from sidebar r=Neil.
Comment 5 Ian Neal 2011-12-30 06:46:47 PST
Comment on attachment 584451 [details] [diff] [review]
Patch v1.0 Proposed Fix.

I seem to remember a patch elsewhere for the sPrefs stuff in MsgComposeCommands.js
Comment 6 Philip Chee 2011-12-30 07:17:41 PST
> Attachment #584453 [details] [diff] - Flags: approval-comm-beta? → approval-comm-beta+
> Attachment #584453 [details] [diff] - Flags: approval-comm-aurora? → approval-comm-aurora+
Pushed:
http://hg.mozilla.org/releases/comm-aurora/rev/994869ef8fad
http://hg.mozilla.org/releases/comm-beta/rev/405c38f9cbec
Comment 7 Philip Chee 2011-12-30 07:20:09 PST
> I seem to remember a patch elsewhere for the sPrefs stuff in MsgComposeCommands.js
sPrefs stub remains until Neil gets around to rewriting the LDAP code.
Comment 8 Philip Chee 2012-01-02 01:47:45 PST
Pushed to comm-central!
http://hg.mozilla.org/comm-central/rev/9de6fd3a8f73
Comment 9 Philip Chee 2012-03-10 04:08:18 PST
*** Bug 734549 has been marked as a duplicate of this bug. ***

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