[wp-trac] [WordPress Trac] #34981: Usage of `image_size_names_choose` breaks JS attachment model attributes

WordPress Trac noreply at wordpress.org
Wed Aug 3 19:37:51 UTC 2022


#34981: Usage of `image_size_names_choose` breaks JS attachment model attributes
-------------------------------------+-----------------------------
 Reporter:  dnaber-de                |       Owner:  joemcgill
     Type:  defect (bug)             |      Status:  assigned
 Priority:  normal                   |   Milestone:  Future Release
Component:  Media                    |     Version:  4.3.1
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+-----------------------------
Changes (by desrosj):

 * milestone:   => Future Release


Comment:

 Came across this one because it was missing a milestone.

 I've refreshed the most recent patch in [attachment:"34981.5.diff"] and
 done some basic testing, and nothing seems to have broken.

 I haven't taken the deep dive into the code to make sure this still makes
 sense, but I did perform a new search of the plugin directory. It looks
 like there are now
 [https://wpdirectory.net/search/01G9JHNGN7VPV38X7BQ9KSYF2D 471
 occurrences] of `image_size_names_choose` in the directory in 297
 different plugins. However, a lot of these are false positives (plugins
 calling `apply_filters( 'image_size_names_choose' )` manually, and a good
 handful are bundling an older version of Advanced Custom Fields which
 [https://github.com/elliotcondon/acf/blob/master/core/fields/image.php#L376
 references the filter and actually calls out oddities mentioned here].

 I also checked the Gutenberg code base, and while the filter is not used
 in the source code, it
 [https://github.com/WordPress/gutenberg/blob/3da717b8d0ac7d7821fc6d0475695ccf3ae2829f/packages
 /e2e-tests/plugins/image-size.php#L32 looks like it's used within end to
 end tests].

 I'm resetting the `Owned by` field because it has been 6+ years without
 any progress. Sometimes contributors shy away from tickets with owners.

 If @joemcgill or any past participants feel like running with this one,
 please feel free to self assign again.

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


More information about the wp-trac mailing list