Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve display of error returned from the REST API when an unsupported image type is uploaded #68788

Open
wants to merge 13 commits into
base: trunk
Choose a base branch
from

Conversation

adamsilverstein
Copy link
Member

@adamsilverstein adamsilverstein commented Jan 20, 2025

Testing

@adamsilverstein
Copy link
Member Author

Unfortunately, this approach leads to a flash of the image showing before the error is received and displayed:

upload.demo.mp4

@adamsilverstein adamsilverstein marked this pull request as ready for review February 10, 2025 16:37
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: adamsilverstein <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@adamsilverstein adamsilverstein added [Type] Enhancement A suggestion for improvement. [Type] Bug An existing feature does not function as intended [Feature] Media Anything that impacts the experience of managing media and removed [Type] Enhancement A suggestion for improvement. labels Feb 10, 2025
@adamsilverstein
Copy link
Member Author

I have removed the Rest API change here leaving only the improved error handling.

Instead I will add the Rest error directly in core in WordPress/wordpress-develop#8322, the change here improves the error display when the mime type is not supported.

Error before

image

Error after

upload error

Screencast

upload.error.w.gb.mp4

@adamsilverstein adamsilverstein changed the title Fix/image upload types via rest api Improve display of error returned from the REST API when an unsupported image type is uploaded Feb 14, 2025
Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @adamsilverstein!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media Anything that impacts the experience of managing media [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants