Opened 3 years ago
Closed 3 years ago
#50325 closed enhancement (fixed)
Misleading error message when upload of an image fails
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Media | Keywords: | good-first-bug has-patch |
Focuses: | administration | Cc: |
Description
If uploading an image fails we get the error
Could not insert post into the database
Yes, every image will have it's post, but the error message should rather say
Your file could not be uploaded for some reason
see
https://build.trac.wordpress.org/browser/trunk/wp-includes/post.php?marks=3983#L3983
Attachments (3)
Change History (8)
#1
@
3 years ago
- Keywords needs-patch good-first-bug added
- Milestone changed from Awaiting Review to Future Release
- Type changed from defect (bug) to enhancement
#3
@
3 years ago
@shital-patel thanks for the patch. Please change the string to:
Could not insert item into the database
#4
@
3 years ago
- Milestone changed from Future Release to 5.5
Thanks for the patch! Just noting that we have a specific message for each data type:
- Could not insert link into the database
- Could not update link in the database
- Could not insert site into the database.
- Could not update site in the database.
- Could not insert post into the database
- Could not update post in the database
- Could not insert term into the database.
- Could not insert term taxonomy into the database.
- Could not insert term relationship into the database.
So, instead of switching to a generic "item", I think it would be better to introduce two new strings for attachments:
- Could not insert attachment into the database.
- Could not update attachment in the database.
This would also be consistent with some special cases for 'attachment' === $post_type
in wp_insert_post()
, e.g. wp_insert_attachment_data
vs wp_insert_post_data
hooks and a few others.
Note: See
TracTickets for help on using
tickets.
The upload didn't fail in this case so your suggestion would be misleading as well. Since this is a rare error message that the end user should see we can simply replace "post" with "item".