Closed Bug 1154481 Opened 5 years ago Closed 5 years ago

New → "Mailing List" always disabled / kAllDirectoryRoot is not defined

Categories

(SeaMonkey :: MailNews: Address Book & Contacts, defect)

defect
Not set

Tracking

(seamonkey2.39 fixed)

RESOLVED FIXED
seamonkey2.39
Tracking Status
seamonkey2.39 --- fixed

People

(Reporter: mnyromyr, Assigned: mnyromyr)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch patch (obsolete) — Splinter Review
Open the address book. Look at the Error Console:

Error: ReferenceError: kAllDirectoryRoot is not defined
Source File: chrome://messenger/content/addressbook/abResultsPane.js
Line: 423

Error: An error occurred updating the cmd_newlist command: [Exception... "[JavaScript Error: "kAllDirectoryRoot is not defined" {file: "chrome://messenger/content/addressbook/abResultsPane.js" line: 423}]'[JavaScript Error: "kAllDirectoryRoot is not defined" {file: "chrome://messenger/content/addressbook/abResultsPane.js" line: 423}]' when calling method: [nsIController::isCommandEnabled]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://global/content/globalOverlay.js :: goUpdateCommand :: line 80"  data: yes]
Source File: chrome://global/content/globalOverlay.js
Line: 85

Select eg. the personal addressbook. Open File → New and find that "Mailing List" is disabled although it shouldn't be in this case.
Attachment #8592488 - Flags: review?(iann_bugzilla)
Assignee: nobody → mnyromyr
Comment on attachment 8592488 [details] [diff] [review]
patch

As TB define this in their abCommon.js should we too instead of here?
Flags: needinfo?(mnyromyr)
(In reply to Ian Neal from comment #1)

> As TB define this in their abCommon.js should we too instead of here?
Actually it's defined in two places, three if you count nsIAbDirectory.idl

* Perhaps kAllDirectoryRoot in nsIAbDirectory.idl should be exposed to JS callers 
http://mxr.mozilla.org/comm-central/source/mailnews/addrbook/public/nsIAbDirectory.idl?rev=84ac3c711098&mark=13-18#13
Then you can do something like:
constg kAllDirectoryRoot = Components.interfaces.nsIAbDirectory.kAllDirectoryRoot;

* The whole of Bug 170270 should be ported not just a constant.
(In reply to Philip Chee from comment #2)
> * Perhaps kAllDirectoryRoot in nsIAbDirectory.idl should be exposed to JS
> callers 
> http://mxr.mozilla.org/comm-central/source/mailnews/addrbook/public/
> nsIAbDirectory.idl?rev=84ac3c711098&mark=13-18#13
> Then you can do something like:
> constg kAllDirectoryRoot =
> Components.interfaces.nsIAbDirectory.kAllDirectoryRoot;

That'd probably be best.

> * The whole of Bug 170270 should be ported not just a constant.

The intention of this bug here was "just" to fix the menu.
On a second look, the New list is also kind of affected, because it doesn't even listen to the controller, so might just fix that here as well.
Anything else is out of scope here, I'd say.
Attachment #8592488 - Attachment is obsolete: true
Attachment #8592488 - Flags: review?(iann_bugzilla)
Flags: needinfo?(mnyromyr)
Attachment #8594220 - Flags: review?(iann_bugzilla)
Comment on attachment 8594220 [details] [diff] [review]
v2 with button wiring [Checked in: Comment 9]

r=me
Will "Perhaps kAllDirectoryRoot in nsIAbDirectory.idl should be exposed to JS callers" be in a follow-up bug, if so, could you create it / reference it?
Flags: needinfo?(mnyromyr)
Attachment #8594220 - Flags: review?(iann_bugzilla) → review+
Status: NEW → ASSIGNED
Keywords: checkin-needed
(In reply to Ian Neal from comment #4)
> Comment on attachment 8594220 [details] [diff] [review]
> v2 with button wiring
> 
> r=me
> Will "Perhaps kAllDirectoryRoot in nsIAbDirectory.idl should be exposed to
> JS callers" be in a follow-up bug, if so, could you create it / reference it?

Will do (after Pentecost).
This might be related to TB Bug 1143812, probably caused by Bug 170270.
Blocks: 170270
See Also: → 1143812
(In reply to Karsten Düsterloh from comment #5)
> > Will "Perhaps kAllDirectoryRoot in nsIAbDirectory.idl should be exposed to
> > JS callers" be in a follow-up bug, if so, could you create it / reference it?
> 
> Will do (after Pentecost).
Yes please.

But hopefully bug 1153840 will clean this up a bit and remove the need of various places to manage the All ABs menuitem and know the kAllDirectoryRoot.
Filed bug bug 1176084 - kAllDirectoryRoot (etc.) in nsIAbDirectory.idl should be exposed to JS callers.
Flags: needinfo?(mnyromyr)
Comment on attachment 8594220 [details] [diff] [review]
v2 with button wiring [Checked in: Comment 9]

https://hg.mozilla.org/comm-central/rev/390e5df881b2
With a=me for the CLOSED TREE
Attachment #8594220 - Attachment description: v2 with button wiring → v2 with button wiring [Checked in: Comment 9]
Is this needed for any other branches?
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Flags: needinfo?(mnyromyr)
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.39
> Is this needed for any other branches?
Not any more.
Flags: needinfo?(mnyromyr)
You need to log in before you can comment on or make changes to this bug.