Open Bug 998778 Opened 11 years ago Updated 2 years ago

reference to undefined property this._caseSensitiveStr findbar.xml Line: 463

Categories

(Thunderbird :: Message Compose Window, defect)

x86
Linux
defect

Tracking

(Not tracked)

People

(Reporter: aceman, Unassigned)

References

Details

After bug 530629 we exposed findbar in Thunderbird editor too. When the findbar is shown, clicking "Match case" produces this error: Warning: ReferenceError: reference to undefined property this._caseSensitiveStr Source file: chrome://global/content/bindings/findbar.xml Line: 463 As TB does not change anything in the findbar, just exposes the findbar, I think this is a toolkit bug. I added some debug output to the findbar.xml code and it shows _updateCaseSensitivity() is called multiple times when the button is clicked. At some calls, this._caseSensitiveStr is found, at some it isn't. It should be checked whether 'this' is always the right object at all calls (e.g. the call from the _observer might be different). The DOM inspector shows <FindToolbar>._caseSensitiveStr is defined (having the "(Case sensitive)" value).
http://mxr.mozilla.org/comm-central/search?string=_caseSensitiveStr > if (!this._notFoundStr) { > let stringsBundle = > Components.classes["@mozilla.org/intl/stringbundle;1"] > .getService(Components.interfaces.nsIStringBundleService) > .createBundle("chrome://global/locale/findbar.properties"); > this._notFoundStr = stringsBundle.GetStringFromName("NotFound"); > this._wrappedToTopStr = > stringsBundle.GetStringFromName("WrappedToTop"); > this._wrappedToBottomStr = > stringsBundle.GetStringFromName("WrappedToBottom"); > this._normalFindStr = > stringsBundle.GetStringFromName("NormalFind"); > this._fastFindStr = > stringsBundle.GetStringFromName("FastFind"); > this._fastFindLinksStr = > stringsBundle.GetStringFromName("FastFindLinks"); > this._caseSensitiveStr = > stringsBundle.GetStringFromName("CaseSensitive"); > } I suggest making the string bundle a proper XBL field/property: <field name="_stringBundle" readonly="true"> <![CDATA[ Components.classes["@mozilla.org/intl/stringbundle;1"] .getService(Components.interfaces.nsIStringBundleService) .createBundle("chrome://global/locale/findbar.properties"); ]]> </field> Then access like: -statusLabel.value = caseSensitive ? this._caseSensitiveStr : ""; +statusLabel.value = caseSensitive ? this._stringBundle.GetStringFromName("CaseSensitive") : "";
There's also a (probably unrelated) nit that checking "match case" on findbar is not inherited to the "Find and Replace" dialog, and vice versa. Perhaps that could be fixed here, too.
(In reply to Thomas D. from comment #2) > There's also a (probably unrelated) nit that checking "match case" on > findbar is not inherited to the "Find and Replace" dialog, and vice versa. > Perhaps that could be fixed here, too. Or maybe not here because it's a TB bug, sorry.
I couldn't reproduce the bug in SeaMonkey, but then again, I can't even get the (Case sensitive) string to display, so maybe I'm doing something wrong somewhere...
The (Case sensitive) string never displays in TB either and I also didn't see it in FF.
Perhaps the original intention was to show this string when you get the "Phrase not found" find bar feedback and "Match case" is active, which would actually be a nice RFE: Phrase not found (case-sensitive!)
Component: Find Toolbar → Message Compose Window
Product: Toolkit → Thunderbird
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.