[wp-trac] [WordPress Trac] #25849: Better Error Messages for the Media Uploader

WordPress Trac noreply at wordpress.org
Mon Oct 27 07:12:41 UTC 2014


#25849: Better Error Messages for the Media Uploader
-------------------------+------------------------------
 Reporter:  chriscct7    |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Media        |     Version:  3.7
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:
-------------------------+------------------------------

Comment (by gcorne):

 As suggested by @chriscct7, there are some improvements that we can make
 to try and better communicate the nature of errors so that users can pass
 along errors so that they can be addressed.

 1. Permission errors are not passed as JSON back to the client with some
 sort of message. While testing, I discovered that the drag and drop
 interface to upload media is not disabled for users that do not have the
 {{{upload_files}}} capability, which is what I used to test this.

 2. Multisite size errors are not passed to the client as JSON. See #29891

 3. In cases where there is some sort of server glitch or misconfiguration,
 the status code of the HTTP response is not provided in the error
 presented to the user.

 In [attachment:25849-01.patch], I added better error responses for the
 permission errors. I also cleaned up the code a bit by using
 {{{wp_send_json_error()}}} and {{{wp_send_json_success()}}}.

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


More information about the wp-trac mailing list