Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#42337 closed defect (bug) (fixed)

Unregistering the Publish Settings section prevents changes from being published

Reported by: westonruter's profile westonruter Owned by: westonruter's profile westonruter
Milestone: 4.9 Priority: normal
Severity: normal Version: 4.9
Component: Customize Keywords: has-patch needs-testing
Focuses: Cc:

Description

In plugins like AMP and Customizer Blank Slate, a stripped-down version of the Customizer is presented where all except for the plugin's own panels, sections, and controls are registered. However, when the Publish Settings section is unregistered then there is no way to change the previous drafted changeset to publish, since the section doesn't exist. The gear icon likewise is presented but it never becomes enabled.

Change History (14)

#1 @westonruter
7 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

First stab at fix is 42337.0.diff where we can register the publish_settings section in JS to ensure that it exists. There was no need to register it in PHP anyway, as no controls were being registered that referenced it anyway.

#2 @westonruter
7 years ago

  • Owner set to westonruter
  • Status changed from new to accepted

#3 @westonruter
7 years ago

  • Version set to trunk

#4 @PerS
7 years ago

Applied the patch to 4.9-beta4-42021, but I can't see any changes, no php or js errors are reported. Meaning, the option wheel is still disabled.

Last edited 7 years ago by PerS (previous) (diff)

#5 @westonruter
7 years ago

@PerS Try clearing your cache? With the AMP plugin I see amp-customizer-gear-icon-enabled.png and amp-customizer-publish-settings-expanded.png when I open AMP Customizer with changes previously drafted.

#6 @PerS
7 years ago

It might be my use of blank slate, I've added blank slate as a mu-plugin: https://soderlind.no/resetting-customizer-wordpress-theme-blank-slate/

Last edited 7 years ago by PerS (previous) (diff)

#7 @westonruter
7 years ago

In 42337.1.diff, unconditionally register core types for panels, sections, and controls so that the required control templates are available when all customize_register actions are removed.

#8 @PerS
7 years ago

I can confirm that the patch is working. My bad, forgot to add define('SCRIPT_DEBUG', true); to wp-config.php

Last edited 7 years ago by PerS (previous) (diff)

#9 @westonruter
7 years ago

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

In 42025:

Customize: Register the Publish Settings section in JS to ensure it does not get unregistered via PHP.

The publish_settings section is a fundamental dependency for Customizer, so it must be guaranteed to be registered.

Also unconditionally register core types for panels, sections, and controls in case plugin unhooks all customize_register actions.

See #39896.
Fixes #42337.

#10 @westonruter
7 years ago

In 42035:

Customize: Ensure id for section and panel is passed among params to respective templates.

Fixes issue where JS-added Publish Settings section failed to get container element ID set properly to hide its section-meta.

Amends [42025].
See #42337, #42083.

Note: See TracTickets for help on using tickets.