[wp-trac] [WordPress Trac] #45890: Customize: 2 browser tabs open in customizer can overwrite widgets of same type

WordPress Trac noreply at wordpress.org
Thu Jan 10 05:18:15 UTC 2019


#45890: Customize: 2 browser tabs open in customizer can overwrite widgets of same
type
--------------------------+------------------------
 Reporter:  mauteri       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Customize     |     Version:  5.0.2
 Severity:  normal        |  Resolution:  duplicate
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------------
Changes (by westonruter):

 * status:  new => closed
 * resolution:   => duplicate
 * milestone:  Awaiting Review =>


Comment:

 You're right. This is an issue. It's previously been reported in #35669:

 > '''Concurrency:''' Since all widget instances of a given type are stored
 in a single option, if two users attempt to update two separate widgets at
 the same time, it is possible that one of the updates will get lost (see
 #31245). Additionally, the widgets admin page and widgets in the
 Customizer both get loaded with the max number (array index) for each
 widget type. When a new widget instance is created, this maximum number is
 incremented in memory and used in the new widget ID which is then passed
 to the server for saving. If two users have loaded the UI at the same
 time, when they both create a widget of a given type and save their widget
 changes, the one who saves last will overwrite the other user's widget
 since the two widgets would have the same ID. (See #32183 for more about
 the widget ID collisions, and see [https://wordpress.org/plugins
 /customize-widgets-plus/ Customize Widgets Plus] for a “Widget Number
 Incrementing” component which uses Ajax to generate new widget IDs in a
 more concurrency-safe manner.)

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


More information about the wp-trac mailing list