[wp-trac] [WordPress Trac] #47987: REST API: Add handling of PHP fatal errors while resizing images after upload

WordPress Trac noreply at wordpress.org
Mon Oct 7 17:05:00 UTC 2019


#47987: REST API: Add handling of PHP fatal errors while resizing images after
upload
-------------------------------------------------+-------------------------
 Reporter:  azaozz                               |       Owner:
                                                 |  TimothyBlynJacobs
     Type:  task (blessed)                       |      Status:  closed
 Priority:  highest omg bbq                      |   Milestone:  5.3
Component:  REST API                             |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch needs-unit-tests dev-      |     Focuses:
  feedback commit                                |
-------------------------------------------------+-------------------------
Changes (by azaozz):

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


Comment:

 In [changeset:"46422" 46422]:
 {{{
 #!CommitTicketReference repository="" revision="46422"
 REST API: Add support for continuing the post-processing of images after
 upload. Flow:
 1. `POST /wp/v2/media`.
 2. If the upload failed (HTTP 500 error), look for a response header with
 `X-WP-Upload-Attachment-ID` header that contains the newly created
 attachment ID.
 3. `POST /wp/v2/media/{id}/post-process` with `{ "action": "create-image-
 subsizes" }`. This request may still fail, but it will save its progress.
 4. On continued failure, `DELETE /wp/v2/media/{id}` to give up on the
 upload and instruct the user to resize their image before uploading.

 Props TimothyBlynJacobs.
 Fixes #47987.
 }}}

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


More information about the wp-trac mailing list