[wp-trac] [WordPress Trac] #53657: Block moves to "Inactive widgets" after saving

WordPress Trac noreply at wordpress.org
Wed Jul 14 16:45:14 UTC 2021


#53657: Block moves to "Inactive widgets" after saving
------------------------------+---------------------------------------
 Reporter:  zieladam          |       Owner:  desrosj
     Type:  defect (bug)      |      Status:  closed
 Priority:  high              |   Milestone:  5.8
Component:  Widgets           |     Version:  trunk
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:  administration, rest-api
------------------------------+---------------------------------------
Changes (by desrosj):

 * owner:  (none) => desrosj
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"51432" 51432]:
 {{{
 #!CommitTicketReference repository="" revision="51432"
 Widgets: Prevent widgets unintentionally being moved to the inactive
 sidebar.

 This fixes a bug where widgets are unintentionally moved to the
 `wp_inactive_widgets` sidebar when batch updates occur through the REST
 API.

 When batch requests are processed, only `$_wp_sidebars_widgets is updated
 by previous calls to `WP_REST_Widgets_Controller::create_item()`.
 `$sidebars_widgets` is not aware of the new widget’s intended location,
 and `retrieve_widgets()` mistakenly flags the widget as inactive.

 Calling `wp_get_sidebars_widgets()` before `retrieve_widgets()` ensures
 both global variables match and is intended as a temporary fix until the
 root cause of the problem can be fixed.

 Props zieladam, htmgarcia, timothyblynjacobs.
 Fixes #53657.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53657#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list