Media tab not working when video and audio uploads are disabled #46658
Labels
[Feature] Inserter
The main way to insert blocks using the + button in the editing interface
[Feature] Media
Anything that impacts the experience of managing media
[Type] Bug
An existing feature does not function as intended
Description
The media tab added in 44918 is not being displayed in case audio and video files uploads are disabled.
The media types in WordPress can be limited (or extended) via
upload_mimes
filter. In case a plugin or a custom code is limiting the upload types to images only.In case such code is in effect, the Gutenberg is producing JS errors as displayed on the screenshot below upon clicking on the Block inserter toggle and no media tab is being displayed.
IMHO, the code should not expect any media types to be allowed for upload, and only display the media tab for allowed media types, if there are any.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: