Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#39335 closed defect (bug) (fixed)

Twenty Seventeen: customize-controls.js incorrectly assumes theme_options section is always present

Reported by: westonruter's profile westonruter Owned by: davidakennedy's profile davidakennedy
Milestone: 4.7.1 Priority: normal
Severity: normal Version: 4.7
Component: Bundled Theme Keywords: has-patch fixed-major
Focuses: Cc:

Description (last modified by westonruter)

Plugins can de-register panels, sections, controls, and settings that are registered by default by core and by themes. As such, themes should use the deferred pattern to interact with such constructs. This is particularly an issue in Twenty Seventeen and now it assumes the theme_options section is present.

Originally reported at https://github.com/xwp/wp-customizer-blank-slate/issues/8

Attachments (1)

39335.0.diff (1.1 KB) - added by westonruter 6 years ago.

Download all attachments as: .zip

Change History (8)

@westonruter
6 years ago

#1 @westonruter
6 years ago

  • Description modified (diff)
  • Keywords has-patch added
  • Owner set to davidakennedy
  • Status changed from new to reviewing

#2 @davidakennedy
6 years ago

Thanks for the report and patch @westonruter! This looks good and worked well in my testing.

#3 @davidakennedy
6 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 39623:

Twenty Seventeen: Ensure functions in customize-controls.js don't count on Customizer sections always being present

Before, the code assumed the theme_options section is always present, but it can be removed by plugins. This way, if it is, no JavaScript errors occur.

Props westonruter.

Fixes #39335.

#4 @westonruter
6 years ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Not 100% sure if this is the right procedure for bundled themes, but re-opening for committing into 4.7 branch.

#5 @dd32
6 years ago

Not 100% sure if this is the right procedure for bundled themes, but re-opening for committing into 4.7 branch.

FTR, yes, Twenty Seventeen fixes will need merging to the 4.7 branch too. @davidakennedy I'm happy to take care of that in one of my merge-storms.

#6 @westonruter
6 years ago

This commit [39623] was merged to the 4.7 branch in [39632] by @pento, though it had a typo in the ticket reference.

#7 @swissspidy
6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.