Closed Bug 627911 Opened 9 years ago Closed 9 years ago

String errors in extensions.js

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set

Tracking

(fennec2.0+)

VERIFIED FIXED
Tracking Status
fennec 2.0+ ---

People

(Reporter: mbrubeck, Assigned: mbrubeck)

References

Details

(Whiteboard: [has-patch])

Attachments

(2 files)

Attached patch patchSplinter Review
Steps to reproduce:
1. Open the add-on panel.
2. Disable your network connection.
3. Try to install an add-on.

Expected results: "Download failed" error message.

Actual results: No error message in the UI; JS errors in the console.

Bug 605494 was written before bug 518111 landed but pushed after, so it still used the old Elements.browserBundle.

Also, there is no aError argument to the addon install listener methods; it's aInstall.error.

Finally, there's a formatStringFromName that's missing it's final argument; looks like this bug has been around undetected for a long time.
Attachment #505995 - Flags: review?(wjohnston)
Comment on attachment 505995 [details] [diff] [review]
patch

>   _createLocalAddon: function ev__createLocalAddon(aAddon) {
>-    let strings = Elements.browserBundle;
>+    let strings = Services.strings.createBundle("chrome://browser/locale/browser.properties");
> 

Can we use Strings.browser here?

Rest looks fine. We should add tests for these failures.
Attachment #505995 - Flags: review?(wjohnston) → review+
Nominating for blocking; cjones ran into this in the wild, and it's a low-risk
fix to some clearly broken corners of the add-on manager UI.
(In reply to comment #1)

> Comment on attachment 505995 [details] [diff] [review]
> Can we use Strings.browser here?

Not in a component.

> Rest looks fine. We should add tests for these failures.

I'll file a followup.
tracking-fennec: --- → ?
Whiteboard: [has-patch]
tracking-fennec: ? → 2.0+
Blocks: 627925
http://hg.mozilla.org/mobile-browser/rev/840639ac20d8

Filed bug 627925 for tests.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
(In reply to comment #2)
> Nominating for blocking; cjones ran into this in the wild, and it's a low-risk
> fix to some clearly broken corners of the add-on manager UI.
> (In reply to comment #1)
> 
> > Comment on attachment 505995 [details] [diff] [review]
> > Can we use Strings.browser here?
> 
> Not in a component.

You're not in a component
Attached patch followupSplinter Review
Replace Services.strings.createBundle(...) with Strings.browser (followup for the mistakenly ignored review in comment 1).
Attachment #520323 - Flags: review?(wjohnston)
Comment on attachment 520323 [details] [diff] [review]
followup

Yay
Attachment #520323 - Flags: review?(wjohnston) → review+
Verified on build: Mozilla /5.0 (Android;Linux armv7l;rv:5.0a2) Gecko/20110414
Firefox/5.0a2 Fennec/5.0a2 
Device: LG Optimus 2X (Android 2.2)
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.