[wp-trac] [WordPress Trac] #20532: Cannot use more than one wp.Uploader (Plupload) instance

WordPress Trac wp-trac at lists.automattic.com
Thu May 17 19:25:44 UTC 2012


#20532: Cannot use more than one wp.Uploader (Plupload) instance
--------------------------+--------------------------
 Reporter:  kovshenin     |       Owner:  koopersmith
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  3.4
Component:  Upload        |     Version:  3.4
 Severity:  normal        |  Resolution:  fixed
 Keywords:                |
--------------------------+--------------------------

Comment (by koopersmith):

 Replying to [comment:3 azaozz]:
 > Shouldn't this be:
 >
 > {{{
 > var object = $.extend({}, object1, object2);
 > }}}
 >
 > so both object1 and object2 are copied instead?

 In this case, since `object1` is a new object, there's no need to copy it
 into a blank object. What we needed was a deep copy, which is why we set
 the first parameter to `true`. If we didn't use deep copy, any default key
 that in the settings that referred to an object (such as the
 `multipart_params` key) would be copied by reference. Since there is only
 one default object, each instance would end up changing the defaults when
 trying to change the settings on the instance.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20532#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list