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

WordPress Trac noreply at wordpress.org
Thu Jul 15 15:42:04 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 fixed-  |     Focuses:  administration, rest-
  major dev-reviewed                 |  api
-------------------------------------+-------------------------------------
Changes (by desrosj):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"51439" 51439]:
 {{{
 #!CommitTicketReference repository="" revision="51439"
 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.
 Merges [51432] to the 5.8 branch.
 Fixes #53657.
 }}}

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


More information about the wp-trac mailing list