[wp-trac] [WordPress Trac] #55367: Requests to the media/edit endpoint are returning a 500 status

WordPress Trac noreply at wordpress.org
Mon Mar 14 16:30:50 UTC 2022


#55367: Requests to the media/edit endpoint are returning a 500 status
---------------------------------------------+-----------------------------
 Reporter:  talldanwp                        |       Owner:  hellofromTonya
     Type:  defect (bug)                     |      Status:  closed
 Priority:  normal                           |   Milestone:  6.0
Component:  REST API                         |     Version:  trunk
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+-----------------------------
Changes (by hellofromTonya):

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


Comment:

 In [changeset:"52932" 52932]:
 {{{
 #!CommitTicketReference repository="" revision="52932"
 Media: Relocate `wp_filesize()` function for use in frontend and backend.

 A new function `wp_filesize()` was added with [52837]. The function lived
 in the `wp-admin/includes/file.php` file. However, this admin specific
 function is not loaded into memory when hitting `media/edit` endpoint. The
 result was a `500` Internal Server Error. Why? The function is invoked
 with that endpoint, but the function does not exist in memory.

 This commit relocates the new function to the `wp-includes/functions.php`
 file. In doing so, the function is available for both the frontend and
 backend.

 Follow-up to [52837].

 Props talldanwp, spacedmonkey, costdev, antonvlasenko.
 Fixes #55367.
 }}}

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


More information about the wp-trac mailing list