Native options always set preference description

RESOLVED FIXED in mozilla37

Status

Add-on SDK
General
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: freaktechnik, Assigned: freaktechnik)

Tracking

unspecified
mozilla37

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

4 years ago
Created attachment 8542967 [details]
undefined-descriptions.xpi

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0
Build ID: 20141125180439

Steps to reproduce:

 - Add a preference without set description to your extension (since it's optional according to https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/simple-prefs#Optional_Common_Attributes), like the extension I attached.
 - Install extension
 - Open extension preference page


Actual results:

The description of the pref is set to "undefined" instead of being omitted. I initially thought that it was jpm related, however it happens with cfx too. I've looked for a possible cause, and this is the only place the description is set without a check if it is actually a description: https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/preferences/native-options.js#L126.


Expected results:

The description should not be set.
(Assignee)

Updated

4 years ago
Blocks: 790323
(Assignee)

Comment 1

4 years ago
Created attachment 8542976 [details] [review]
Pull Request
Attachment #8542976 - Flags: review?
(Assignee)

Updated

4 years ago
Attachment #8542976 - Attachment description: Pull Reques$t → Pull Request
(Assignee)

Updated

4 years ago
Attachment #8542976 - Flags: review? → review?(tomica+amo)
Comment on attachment 8542976 [details] [review]
Pull Request

nice work Martin, r+.

i left a few nit comments, if you could please address them (and then squash into one commit), that would be great.

thanks.
Attachment #8542976 - Flags: review?(tomica+amo) → review+
Assignee: nobody → zm.redaktion
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Comment 3

4 years ago
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/bd84fbb0b8929a8f11f6a62bb0e90be504e4689c
Bug 1116761: Don't display 'undefined' when no setting description is set

https://github.com/mozilla/addon-sdk/commit/af153444ce2533a0e3e4e6a57a483109c3fc5dfb
Merge pull request #1791 from freaktechnik/fix-undefined-descriptions

Bug 1116761 - Don't display 'undefined' when no setting description is set, r=@zombie
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.