[wp-trac] [WordPress Trac] #34152: Several audio players on the same page get their controls mixed up

WordPress Trac noreply at wordpress.org
Mon Oct 5 13:41:06 UTC 2015


#34152: Several audio players on the same page get their controls mixed up
--------------------------+------------------------------
 Reporter:  Fab1en        |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  4.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  javascript
--------------------------+------------------------------
Changes (by Fab1en):

 * keywords:   => has-patch
 * status:  closed => reopened
 * resolution:  duplicate =>


Comment:

 I still think that something should be fixed here.

 When I look at the JavScript source code, I see that the `_wpmejsSettings`
 global variable is copied into a local `settings` variable. But then,
 `settings.success` is changed so `_wpmejsSettings.success` is also
 impacted. Assigning a variable to an object only assigns the reference,
 and does not copy the entire object. In the following patch, I propose to
 use the undescore utility `_.clone` to get a fully private copy of
 `_wpmejsSettings` before assigning it to the local variable.

 [34346] only fixes this bug because it changes the execution order, but
 the root cause is still there.

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


More information about the wp-trac mailing list