[wp-trac] [WordPress Trac] #48200: Fix the method used to create image sub-sizes when uploading fails with a PHP fatal error

WordPress Trac noreply at wordpress.org
Sat Oct 5 17:40:42 UTC 2019


#48200: Fix the method used to create image sub-sizes when uploading fails with a
PHP fatal error
--------------------------+-----------------------
 Reporter:  azaozz        |       Owner:  azaozz
     Type:  defect (bug)  |      Status:  reopened
 Priority:  high          |   Milestone:  5.3
Component:  Upload        |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+-----------------------

Comment (by TimothyBlynJacobs):

 > This will change the way (prevent) how this is used outside the API.
 With 48200.2.diff it won't be able to retry to make sub-sizes when using
 wp_create_image_subsizes() or wp_update_image_subsizes() directly.

 How so? The only time that the header is needed is when uploading an
 attachment and immediately processing the sub-sizes. If someone provides a
 media upload endpoint, for instance a front-end form of some kind, they
 don't necessarily also have the equivalent of
 `wp_ajax_media_create_image_subsizes` or `wp/v2/media/{id}/post-process`.
 So sending the attachment ID header isn't useful information.

 Like I said, I don't think it is strictly necessary. But it seemed cleaner
 to only send the information when it is necessary. If I called
 `wp_create_image_subsizes`, I don't think I'd expect that function to send
 any output.

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


More information about the wp-trac mailing list