Closed Bug 1249742 Opened 4 years ago Closed 4 years ago

Localized values in distribution.js aren't being properly unset

Categories

(Firefox :: Distributions, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 47
Tracking Status
firefox47 --- fixed

People

(Reporter: mkaply, Assigned: mkaply)

Details

Attachments

(1 file)

In:

https://wiki.mozilla.org/Distribution_INI_File

it says:

# Preferences set in override sections are *merged* with the
# localizable defaults.  That is, if you want a pref in
# [LocalizablePreferences] to not be set in a particular locale,
# you'll need to unset it explicitly ("pref.name=" on a line of its
# own).

Unfortunately, that's not what happens. The preference gets set to "undefined":

data:text/plain,distribution.searchplugins.defaultLocale=undefined
Assignee: nobody → mozilla
There does not seem to be a way to unset a default value once set.

So the best we can do is set it to be empty.
My fix doesn't work because it shows off this bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=1250615

I have a much better fix for this that also includes a test suite.
Comment on attachment 8721469 [details]
MozReview Request: Bug 1249742 - If a localized pref is overridden, don't set it; r?mixedpuppy

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/35683/diff/1-2/
Attachment #8721469 - Attachment description: MozReview Request: Bug 1249742 - Allow localizable prefs in distribution.js to be unset; r?mixedpuppy → MozReview Request: Bug 1249742 - If a localized pref is overridden, don't set it; r?mixedpuppy
Argh. That moz.build change shouldn't be in there. I accidentally amended the commit without specifying the filename.
Comment on attachment 8721469 [details]
MozReview Request: Bug 1249742 - If a localized pref is overridden, don't set it; r?mixedpuppy

https://reviewboard.mozilla.org/r/35683/#review33039

Any chance for a test for this?  Also remove moz.build as you mentioned in the bug it shouldn't be part of this.
Attachment #8721469 - Flags: review?(mixedpuppy)
I've created a test for all of the distribution prefs.

I'll do that tomorrow before this bug.
Comment on attachment 8721469 [details]
MozReview Request: Bug 1249742 - If a localized pref is overridden, don't set it; r?mixedpuppy

https://reviewboard.mozilla.org/r/35683/#review33257

Looks like the patch in bug 436564 should handle tests for this.  If moz.build isn't part of this remove it.  otherwise r+
Component: General → Distributions
https://hg.mozilla.org/integration/fx-team/rev/b5c0cd56381547fe527c724d86eb955c209e0a6e
Bug 1249742 - Don't set prefs at all if overridden by lang or locale; r=mixedpuppy
https://hg.mozilla.org/mozilla-central/rev/b5c0cd563815
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 47
You need to log in before you can comment on or make changes to this bug.