[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
Thu Oct 3 01:56:52 UTC 2019
#48200: Fix the method used to create image sub-sizes when uploading fails with a
PHP fatal error
--------------------------+---------------------
Reporter: azaozz | Owner: (none)
Type: defect (bug) | Status: new
Priority: high | Milestone: 5.3
Component: Upload | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+---------------------
Comment (by azaozz):
In 48200.diff:
- Remove the use of an "upload ref" send by the client and the helper
functions to set/get the attachment_id.
- Set a custom header with the attachment_id after an image file is
uploaded and attachment post created, but before any sub-sizes are made.
This ensures the new attachment_id is always sent back to the
client/browser, even when there is a PHP fatal error.
- Change the Plupload handlers to use the header.
Tested this quite a bit and it seems to work even better than before.
Thanks @timothyblynjacobs for the idea and @clorith for the help :)
Please test, planning to commit it asap.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48200#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list