Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add error notices mechanism directly to media placeholder #6957
This change makes upload error notices available in all blocks.
I noticed while adding the error messages to other blocks(besides gallery and image) that the best way to not duplicate code and make block creation easier would be to have the messages being directly handled in media placeholder as most blocks only allow uploading via media library (that already as this errors via core functionality) and via media placeholders that now have this messages too.
Making error notices available directly in media placeholder makes all blocks even the ones created by the community take advantage of our upload error notices system.
How has this been tested?
Upload files with sizes bigger than the maximum file size allowed in all blocks with media placeholders (gallery, image, audio, video, cover-image) and verify the message is correctly displayed.
This was referenced
May 27, 2018
I think this is the right approach and the path is right but we could maybe tidy up the API and some minor variable naming stuff. Do you think the
disable prop approach makes a bit more sense or is that kind of "set disable to true" approach universally rejected in Gutenberg?
Looks good; I left some points I think could be improved a bit but good to go with comments addressed or ignored-if-thought-incorrect.