[wp-trac] [WordPress Trac] #61519: Unable to pick a featured image due to JS error

WordPress Trac noreply at wordpress.org
Thu Jun 27 11:42:40 UTC 2024


#61519: Unable to pick a featured image due to JS error
--------------------------+-----------------------------
 Reporter:  david.binda   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 After r58563 there is a JS error in the media picker which results in just
 the first single from the media library being loaded upon clicking to "Set
 featured image" in the post editor.

 The JS error is as follows:


 {{{
 TypeError: t.get is not a function
     at n.comparator (media-models.min.js?ver=6.6-RC1:2:5566)
     at e.comparator (media-views.min.js?ver=6.6-RC1:2:7240)
     at Array.sort (<anonymous>)
     at n.sort (backbone.min.js?ver=1.5.0:2:11690)
     at n.set (backbone.min.js?ver=1.5.0:2:10286)
     at n.add (backbone.min.js?ver=1.5.0:2:8973)
     at n.validate (media-models.min.js?ver=6.6-RC1:2:2960)
     at n._validateHandler (media-models.min.js?ver=6.6-RC1:2:3953)
     at p (backbone.min.js?ver=1.5.0:2:3818)
     at f (backbone.min.js?ver=1.5.0:2:3497)
 }}}

 While I'm still not sure what the root cause is, it seems like reverting
 the mentioned changeset for the wp-includes/js/media-views.min.js file
 only fixes the issue.

 Steps to reproduce:

 1. make sure the minified versions of the JS files are being loaded ( eg.:
 no SCRIPT_DEBUG )
 1. have more than 1 image uploaded in a media library (eg.: 2)
 1. go to wp-admin/post-new.php
 1. click the "Set featured image" in the right hand side panel (on the
 Post level)
 1. see that just a single image got loaded, observe the JS error in the
 console

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61519>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list