Skip to content

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
@github-actions
Copy link

github-actions bot commented Feb 10, 2025

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]>
Co-authored-by: Mamaduka <[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!

@Mamaduka Mamaduka added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Feb 17, 2025
@github-actions github-actions bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Feb 17, 2025
Copy link
Member

@swissspidy swissspidy left a comment

Choose a reason for hiding this comment

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

@adamsilverstein Could we add a test for this? Makes it easier to understand this particular code.

@Mamaduka Mamaduka merged commit eeb0d1b into WordPress:trunk Feb 17, 2025
63 checks passed
@swissspidy
Copy link
Member

Could we add a test for this? Makes it easier to understand this particular code.

ok @Mamaduka was faster 😄

@github-actions github-actions bot added this to the Gutenberg 20.4 milestone Feb 17, 2025
@Mamaduka
Copy link
Member

Oh, sorry. @swissspidy. I merged while your comment was posted. We could do a follow-up with a test as needed.

@Infinite-Null
Copy link
Contributor

Infinite-Null commented Feb 17, 2025

I would love to try adding a test for this @Mamaduka and @swissspidy. May I open a follow-up PR for this?

@swissspidy
Copy link
Member

@Infinite-Null already done here: #69215

@Infinite-Null
Copy link
Contributor

oo ok didn't see that 😅.

Kallyan01 pushed a commit to Kallyan01/gutenberg that referenced this pull request Feb 24, 2025
…ed image type is uploaded (WordPress#68788)


Co-authored-by: adamsilverstein <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
…ed image type is uploaded (WordPress#68788)


Co-authored-by: adamsilverstein <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
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.

4 participants