[wp-trac] [WordPress Trac] #57893: Remove the redundancy of adding row actions in `class-wp-media-list-table.php`

WordPress Trac noreply at wordpress.org
Tue Jun 20 17:58:53 UTC 2023


#57893: Remove the redundancy of adding row actions in `class-wp-media-list-
table.php`
-------------------------------------------------+-------------------------
 Reporter:  kebbet                               |       Owner:
                                                 |  SergeyBiryukov
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.3
Component:  Media                                |     Version:  3.1
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing has-         |     Focuses:  ui
  testing-info                                   |
-------------------------------------------------+-------------------------
Changes (by costdev):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 @SergeyBiryukov [https://github.com/WordPress/wordpress-develop/pull/4364
 PR 4364] included a check that `$attachment_url` was truthy before adding
 the `copy` and `download` actions. This wasn't included in [55949], so the
 `copy` and `download` actions may added with an empty string URL if
 `wp_get_attachment_url()` returns `false`.

 Applying `add_filter( 'wp_get_attachment_url', '__return_false' );` shows
 that when clicking `Copy URL` or `Download`. `Copy` won't do anything, and
 `Download` will download the `wp-admin/upload.php` as an HTML file.

 I'm preparing a PR with the conditions added as well as PHPUnit tests to
 protect the behaviour touched in [55949]. I'll have this ready later this
 evening.

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


More information about the wp-trac mailing list