Last Comment Bug 628785 - Firefox should define a value for extensions.getAddons.recommended.url so AddonRepoistory.retrieveRecommendedAddons() works
: Firefox should define a value for extensions.getAddons.recommended.url so Add...
Status: RESOLVED FIXED
[good first bug]
: regression
Product: Toolkit
Classification: Components
Component: Add-ons Manager (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla23
Assigned To: Sachin Hosmani [:sachin]
:
Mentors:
Depends on:
Blocks: 554007
  Show dependency treegraph
 
Reported: 2011-01-25 13:31 PST by Eric Shepherd [:sheppy]
Modified: 2013-04-16 10:55 PDT (History)
5 users (show)
blair: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
If the preference doesn't exist, it uses the default value. (4.62 KB, patch)
2013-04-13 00:13 PDT, Sachin Hosmani [:sachin]
blair: review-
Details | Diff | Splinter Review
Creates the preference with a default value. (9.60 KB, patch)
2013-04-14 03:37 PDT, Sachin Hosmani [:sachin]
blair: review+
Details | Diff | Splinter Review

Description Eric Shepherd [:sheppy] 2011-01-25 13:31:33 PST
I don't have a value set for this preference, so the AddonRepository.jsm API fails immediately instead of attempting to load recommendations when I call retrieveRecommendedAddons(). If this pref is missing, an appropriate default should be used.
Comment 1 Eric Shepherd [:sheppy] 2011-01-25 13:48:08 PST
Looks like no default is set for this preference on a fresh install of Firefox. Setting the preference to:

https://services.addons.mozilla.org/%LOCALE%/%APP%/api/%API_VERSION%/list/recommended/all/%MAX_RESULTS%/%OS%/%VERSION%?src=firefox

Makes the API start to work.
Comment 2 Dave Townsend [:mossop] 2011-01-25 13:49:24 PST
Not going to be a blocker but we should probably re-add the preference back so the API continues to work.
Comment 3 Henrik Skupin (:whimboo) 2011-01-25 14:29:51 PST
Dave, do we make use of the URL in any of our UI? Or is it a method which can be used by add-ons?
Comment 4 Dave Townsend [:mossop] 2011-01-25 14:35:57 PST
(In reply to comment #3)
> Dave, do we make use of the URL in any of our UI? Or is it a method which can
> be used by add-ons?

We don't use it in the UI anymore but the API is still available for add-ons.
Comment 5 Henrik Skupin (:whimboo) 2011-01-25 14:52:50 PST
Regression from bug 554007.
Comment 6 Sachin Hosmani [:sachin] 2013-04-13 00:13:22 PDT
Created attachment 737093 [details] [diff] [review]
If the preference doesn't exist, it uses the default value.

No preference was created, though.
Please tell me where the other preferences are created, if I have to create a preference for this.
Comment 7 Blair McBride [:Unfocused] (UNAVAILABLE) 2013-04-14 02:31:29 PDT
Comment on attachment 737093 [details] [diff] [review]
If the preference doesn't exist, it uses the default value.

Review of attachment 737093 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for jumping in to fix this, Sachin. Sorry for the confusion here - we don't support default preferences for URLs in the code (ie, AddonRepository.jsm shouldn't be modified to support this). As comment 2 says, all we need is a value for this preference added here:
http://mxr.mozilla.org/mozilla-central/source/browser/app/profile/firefox.js#44

Other apps will have to set the value for the pref if they want to have that API be usable, same as every other URL the Add-ons Manager uses.
Comment 8 Sachin Hosmani [:sachin] 2013-04-14 03:37:58 PDT
Created attachment 737225 [details] [diff] [review]
Creates the preference with a default value.

Thanks Blair, for the review.
Comment 9 Blair McBride [:Unfocused] (UNAVAILABLE) 2013-04-14 15:06:39 PDT
Comment on attachment 737225 [details] [diff] [review]
Creates the preference with a default value.

Review of attachment 737225 [details] [diff] [review]:
-----------------------------------------------------------------

Wonderful, thanks :)
Comment 10 Blair McBride [:Unfocused] (UNAVAILABLE) 2013-04-14 15:14:23 PDT
Landed on the fx-team branch, which should get merged into mozilla-central within a day or two:

https://hg.mozilla.org/integration/fx-team/rev/00c7171cf12c
Comment 11 Tim Taubert [:ttaubert] 2013-04-16 10:55:56 PDT
https://hg.mozilla.org/mozilla-central/rev/00c7171cf12c

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