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

Blocks: File block doesn't handle unallowed file types #8025

Closed
aduth opened this issue Jul 18, 2018 · 0 comments
Closed

Blocks: File block doesn't handle unallowed file types #8025

aduth opened this issue Jul 18, 2018 · 0 comments
Assignees
Labels
[Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended

Comments

@aduth
Copy link
Member

aduth commented Jul 18, 2018

Describe the bug

The Files block fails to handle the case where a user drops a file type not allowed by the server. It presents the loading display forever. If the user then proceeds to save the post and reload the page, the block fails with an unhandled error.

To Reproduce

Steps to reproduce the behavior:

  1. Navigate to Posts > Add New
  2. Drag an unsupported file from your computer to the editor (maybe .exe)
  3. Observe that a file block is inserted (since it handles any files dropped), but that it pulses forever
  4. Save the post
  5. Reload the editor
  6. Observe that the File block has encountered an error

Expected behavior

  • The Files block should not attempt to handle unsupported file types
  • Insertion point shouldn't be offered
  • Even if it tried to handle, if the upload failed for any reason, this should at least be communicated to the user
  • There should be no block errors when reloading the saved post

Screenshots

Uploading (indefinitely):

loading

Error:

image

Error text:

mediaupload.js:83 Uncaught TypeError: Cannot read property 'type' of undefined
at mediaupload.js:83
at Array.forEach ()
at mediaUpload (mediaupload.js:82)
at editorMediaUpload (index.js:33)
at FileEdit.componentDidMount (edit.js:58)
at commitLifeCycles (react-dom.24169eaf.js:14939)
at commitAllLifeCycles (react-dom.24169eaf.js:16040)
at HTMLUnknownElement.callCallback (react-dom.24169eaf.js:140)
at Object.invokeGuardedCallbackDev (react-dom.24169eaf.js:178)
at invokeGuardedCallback (react-dom.24169eaf.js:227)

Desktop (please complete the following information):

  • OS: macOS High Sierra 10.13.6 (17G65)
  • Browser: Chrome Version 67.0.3396.99 (Official Build) (64-bit)
@aduth aduth added [Type] Bug An existing feature does not function as intended [Feature] Blocks Overall functionality of blocks labels Jul 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants