Fix notified button name in SDK native-options module

RESOLVED FIXED in Firefox 48

Status

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: rpl, Assigned: rpl)

Tracking

unspecified
mozilla48

Firefox Tracking Flags

(firefox48 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
Unfortunately the jetpack test suite didn't catched that in the changes introduced by Bug 1167246 the name of the button is now used in a closure and the command handler of the add-on preferences button will notify the wrong preference name if the button is not the last element of the preferences array.
(Assignee)

Comment 1

3 years ago
Created attachment 8739411 [details]
MozReview Request: Bug 1263140 - fix notified button name in SDK native-options module. r=mossop

Review commit: https://reviewboard.mozilla.org/r/45263/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/45263/
Attachment #8739411 - Flags: review?(dtownsend)
Comment on attachment 8739411 [details]
MozReview Request: Bug 1263140 - fix notified button name in SDK native-options module. r=mossop

https://reviewboard.mozilla.org/r/45263/#review41755

::: addon-sdk/source/lib/sdk/preferences/native-options.js:136
(Diff revision 1)
>  // dynamically injects inline options into about:addons page at runtime
>  // NOTE: on Firefox Desktop the about:addons page is a xul page document,
>  // on Firefox for Android the about:addons page is an xhtml page, to support both
>  // the XUL xml namespace have to be enforced.
>  function injectOptions({ preferences, preferencesBranch, document, parent, id }) {
>    for (let { name, type, hidden, title, description, label, options, on, off } of preferences) {

Can you instead make this

    preferences.forEach(({name, type, hidden, title, description, label, options, on, off}) => {
    ...
    });

That should solve the issue and make sure it doesn't catch us elsewhere.
Attachment #8739411 - Flags: review?(dtownsend) → review+
(Assignee)

Comment 3

3 years ago
(In reply to Dave Townsend [:mossop] from comment #2)
> Comment on attachment 8739411 [details]
> MozReview Request: Bug 1263140 - fix notified button name in SDK
> native-options module. r?mossop
> 
> https://reviewboard.mozilla.org/r/45263/#review41755
> 
> ::: addon-sdk/source/lib/sdk/preferences/native-options.js:136
> (Diff revision 1)
> >  // dynamically injects inline options into about:addons page at runtime
> >  // NOTE: on Firefox Desktop the about:addons page is a xul page document,
> >  // on Firefox for Android the about:addons page is an xhtml page, to support both
> >  // the XUL xml namespace have to be enforced.
> >  function injectOptions({ preferences, preferencesBranch, document, parent, id }) {
> >    for (let { name, type, hidden, title, description, label, options, on, off } of preferences) {
> 
> Can you instead make this
> 
>     preferences.forEach(({name, type, hidden, title, description, label,
> options, on, off}) => {
>     ...
>     });
> 
> That should solve the issue and make sure it doesn't catch us elsewhere.

sure, and I like it more than my proposed one.
(Assignee)

Comment 4

3 years ago
Comment on attachment 8739411 [details]
MozReview Request: Bug 1263140 - fix notified button name in SDK native-options module. r=mossop

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/45263/diff/1-2/
Attachment #8739411 - Attachment description: MozReview Request: Bug 1263140 - fix notified button name in SDK native-options module. r?mossop → MozReview Request: Bug 1263140 - fix notified button name in SDK native-options module. r=mossop
(Assignee)

Comment 5

3 years ago
https://reviewboard.mozilla.org/r/45263/#review41755

> Can you instead make this
> 
>     preferences.forEach(({name, type, hidden, title, description, label, options, on, off}) => {
>     ...
>     });
> 
> That should solve the issue and make sure it doesn't catch us elsewhere.

Patch updated as suggested in the review comment.
(Assignee)

Updated

3 years ago
Assignee: nobody → lgreco
Status: NEW → ASSIGNED
(Assignee)

Updated

3 years ago
Keywords: checkin-needed

Comment 8

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/6553edb04f02
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox48: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.