WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#30378 closed defect (bug) (fixed)

Empty widget areas get deactivated in the Customizer

Reported by: celloexpressions Owned by: ocean90
Milestone: 4.1 Priority: normal
Severity: blocker Version: 4.1
Component: Customize Keywords: has-patch
Focuses: javascript Cc:

Description

There's a regression here, likely related to #28709, been confirmed by several people in slack. Makes it impossible to add new widget to an empty sidebar in the Customizer - once it's emptied it becomes inactive (hiding).

Attachments (1)

30378.diff (851 bytes) - added by westonruter 5 years ago.
https://github.com/xwp/wordpress-develop/pull/55

Download all attachments as: .zip

Change History (6)

#1 @westonruter
5 years ago

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

Here is a shortcut which can be pasted into the browser console to empty out all sidebars to trigger the bad behavior:

_.each( wp.customize.panel('widgets').sections(), function ( section ) {
    var controls = section.controls(); 
    controls.pop().setting( [] ); // the last control is the SidebarWidgets control, the list of widget IDs in the sidebar
} );

#2 @westonruter
5 years ago

  • Keywords has-patch added; needs-patch removed
  • Owner changed from westonruter to ocean90
  • Status changed from assigned to reviewing

The problem seems to be the SidebarSection.isContextuallyActive override of Section.isContextuallyActive, which was introduced in #30235, specifically via commit c91db4d. This method override actually was taking things too far. Now that that SidebarSection's active state is getting sent from the Preview, we can just rely on it to show/hide the section. We don't want to hide a section if all of the widgets in a section are removed or if they are all inactive (e.g. hidden via Jetpack Widget Visibility). So the method override I added was just plain wrong, I believe.

In 30378.diff I remove this method override.

This ticket was mentioned in Slack in #core by westonruter. View the logs.


5 years ago

This ticket was mentioned in Slack in #core by ocean90. View the logs.


5 years ago

#5 @ocean90
5 years ago

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

In 30552:

Customizer: Don't override Section.isContextuallyActive() in SidebarSection.

This fixes a bug where empty widget areas get deactivated in the Customizer.

fixes #30378.
see #30235.
props westonruter.

Note: See TracTickets for help on using tickets.