[wp-trac] [WordPress Trac] #24094: "Blank" media item in "Insert Media" popup

WordPress Trac noreply at wordpress.org
Tue Apr 16 13:56:26 UTC 2013


#24094: "Blank" media item in "Insert Media" popup
------------------------------------+--------------------
 Reporter:  batmoo                  |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  high                    |   Milestone:  3.6
Component:  Media                   |     Version:  trunk
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+--------------------
Changes (by kovshenin):

 * keywords:  needs-patch => has-patch dev-feedback


Comment:

 Spent some time (again) poking this around today and came up with
 [attachment:24094.diff] which I'm not sure is the right thing to do, so
 would appreciate some feedback.

 It looks like before [23893], the `media.model.Attachments.parse` method
 is fired only once when `sync` is complete, but after the changeset, it's
 fired once for the collection sync, and then once again for each
 attachment that was fetched.

 The closest reason I found is the following note in the Backbone's 0.9.9
 [http://backbonejs.org/#changelog changelog] (although it works perfectly
 fine in 0.9.10):
 > After fetching a model or a collection, all defined parse functions will
 now be run. So fetching a collection and getting back new models could
 cause both the collection to parse the list, and then each model to be
 parsed in turn, if you have both functions defined.

 If that's what's causing the multiple calls to `parse`, then removing it
 seems like an okay thing to do, since the individual attachments will
 still get their own `parse` method called.

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


More information about the wp-trac mailing list