Beginning on October 25th, 2016, Persona will no longer be an option for authentication on BMO. For more details see Persona Deprecated.
Last Comment Bug 709819 - entries in languages menu of context menu get multiplied several times
: entries in languages menu of context menu get multiplied several times
[mentor=Neil][lang=js][good first bug]
Product: SeaMonkey
Classification: Client Software
Component: MailNews: Composition (show other bugs)
: Trunk
: All All
: -- normal (vote)
: seamonkey2.11
Assigned To: Edmund Wong (:ewong)
Depends on:
Blocks: 751053
  Show dependency treegraph
Reported: 2011-12-12 09:05 PST by Martin Honnen
Modified: 2012-05-02 02:11 PDT (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

Remove entries from languages menu before recreating language list. (1.35 KB, patch)
2012-03-25 08:36 PDT, Edmund Wong (:ewong)
neil: review-
Details | Diff | Splinter Review
Remove language entries. (V2) (682 bytes, patch)
2012-03-26 02:21 PDT, Edmund Wong (:ewong)
neil: review+
bugspam.Callek: approval‑comm‑aurora+
bugspam.Callek: approval‑comm‑beta+
Details | Diff | Splinter Review

Description Martin Honnen 2011-12-12 09:05:07 PST
The problem occurs within the "languages" sub menu of the context menu of the compose window, where you are supposed to select the right language for spell checking. When I used that menu to select a language in one instance of the compose window, close that window, open a new one and try the menu again the entries in that menu are duplicated and when you repeat that approach the menu keeps growing until a restart of SeaMonkey.

Initially the problem occurred for me when I used the English US version of SeaMonkey and had an additional German dictionary installed. However I uninstalled the German dictionary and started SeaMonkey in "safe mode", yet the problem persists, I then get several "English / United States" entries once I used the menu as described above.

A screen shot is at

At least one other user has confirmed the problem in
Comment 1 Philip Chee 2011-12-12 10:08:03 PST
This sounds like Bug 688860 which also involve multiple compose windows and spell checking. If you feel confident enough you could try the latest SeaMonkey 2.8a1 builds. But make sure you test this on a separate profile you can thow away if necessary.
Comment 2 Jens Hatlak (:InvisibleSmiley) 2012-01-19 14:27:00 PST
I can reproduce this on Linux, with anything from SM 2.2 to current SM trunk (2.9a1). Nothing on the Error Console. Probably an issue with initialization vs. compose window recycling? Maybe Neil knows.

SM 2.1 behaves differently; I don't have that menu item there and the Spelling toolbar button is broken. :-/ SM 2.0 doesn't have the menu item either, so I guess it was introduced with SM 2.2. I didn't find anything in the corresponding release notes, though. :-/
Comment 3 2012-01-19 16:46:49 PST
The inline spellcheck UI gets reinitialised every time the compose window is reopened. As part of initialisation, it forgets about any menuitems that it added to the context menu...

There is a function that removes the menuitems, which would fix the problem, if only there was a convenient place to call it...
Comment 4 2012-01-20 06:27:08 PST
Ah of course, the compose recycling listener already removes the suggestions from the menu, so we just need to remove the dictionaries at the same time.
Comment 5 Philip Chee 2012-01-21 11:00:05 PST
I suppose I should also add [good first bug] in case some one is searching bugzilla for the old GFB whiteboard status.
Comment 6 Edmund Wong (:ewong) 2012-03-25 08:36:46 PDT
Created attachment 609123 [details] [diff] [review]
Remove entries from languages menu before recreating language list.
Comment 7 Jens Hatlak (:InvisibleSmiley) 2012-03-25 09:43:42 PDT
Comment on attachment 609123 [details] [diff] [review]
Remove entries from languages menu before recreating language list.

Review of attachment 609123 [details] [diff] [review]:

::: suite/common/nsContextMenu.js
@@ +332,2 @@
>        InlineSpellCheckerUI.addDictionaryListToMenu(dictMenu, dictSep);
>      }

Drive-by nit: With the block reduced to a single line, the braces can go.
Comment 8 2012-03-25 10:09:22 PDT
Comment on attachment 609123 [details] [diff] [review]
Remove entries from languages menu before recreating language list.

This isn't the correct way to remove dictionaries form the menu. The correct way is

Note of course that this already exists in nsContextMenu.js, so the problem is specific to the message compose window, because of the way it recycles.
Comment 9 Edmund Wong (:ewong) 2012-03-26 02:21:03 PDT
Created attachment 609257 [details] [diff] [review]
Remove language entries. (V2)
Comment 10 Jens Hatlak (:InvisibleSmiley) 2012-03-26 10:52:53 PDT
Once this has landed and verified, we should get this onto both Aurora and Beta.
Comment 11 Edmund Wong (:ewong) 2012-03-26 18:54:43 PDT
Pushed to comm-central:
Comment 12 Edmund Wong (:ewong) 2012-03-26 18:55:01 PDT
Comment on attachment 609257 [details] [diff] [review]
Remove language entries. (V2)

[Approval Request Comment]
Regression caused by (bug #): 
User impact if declined: 
Testing completed (on m-c, etc.): 
Risk to taking this patch (and alternatives if risky):
String changes made by this patch:
Comment 13 Edmund Wong (:ewong) 2012-03-26 21:11:24 PDT
Pushed to comm-aurora:
Comment 14 Edmund Wong (:ewong) 2012-03-26 21:52:48 PDT
Pushed to comm-beta:

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