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 'upload_files' capability checks in the editor #11910

Closed
gziolo opened this issue Nov 15, 2018 · 1 comment · Fixed by #11924
Closed

Improve 'upload_files' capability checks in the editor #11910

gziolo opened this issue Nov 15, 2018 · 1 comment · Fixed by #11924
Labels
[Block] File Affects the File Block [Feature] Drag and Drop Drag and drop functionality when working with blocks [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Type] Bug An existing feature does not function as intended

Comments

@gziolo
Copy link
Member

gziolo commented Nov 15, 2018

Previous work to verify 'upload_files' capability when displaying upload UI in media blocks was done by @imath for #3672 in #4155.

I found new ways to trigger upload UI which should be fixed.

Select Poster Image

  1. Add a Video block.
  2. Insert a video from url.
  3. Click on Select Poster Image.
  4. Media upload modal will show up.

screen shot 2018-11-15 at 11 47 54

Drag & Drop file

  1. Drag & Drop file to the editor from a folder.
  2. It will create a File block with a strange error.
  3. Click Edit icon and Media upload modal will show up.

screen shot 2018-11-15 at 11 51 24

Drag & Drop image

  1. Drag & Drop image to the editor from a folder.
  2. It will create an Image block. It probably will be broken.
  3. Click Edit icon and Media upload modal will show up.

screen shot 2018-11-15 at 11 52 00

@gziolo gziolo added the [Type] Bug An existing feature does not function as intended label Nov 15, 2018
@gziolo gziolo added this to the WordPress 5.0 RC milestone Nov 15, 2018
@gziolo gziolo added [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Block] File Affects the File Block [Feature] Drag and Drop Drag and drop functionality when working with blocks labels Nov 15, 2018
@imath
Copy link
Contributor

imath commented Nov 15, 2018

Thanks for adding this issue as a follow-up of #4155. I've just started working on these forgotten cases. I will try to post a PR asap.

imath added a commit to imath/gutenberg that referenced this issue Nov 17, 2018
This PR should fix WordPress#11910

1. It adds a MediaUploadCheck component before the forgotten MediaUpload components used directly in some blocks :
- within the edit toolbar buttons of the cover, file and image blocks,
- within the Poster image setting of the video block.
2. It also adds a MediaUploadCheck component before rendering the Block Drop Zone.
gziolo pushed a commit that referenced this issue Nov 17, 2018
* Use the MediaUploadCheck component before each Upload component

This PR should fix #11910

1. It adds a MediaUploadCheck component before the forgotten MediaUpload components used directly in some blocks :
- within the edit toolbar buttons of the cover, file and image blocks,
- within the Poster image setting of the video block.
2. It also adds a MediaUploadCheck component before rendering the Block Drop Zone.

* Edit the MediaUpload documentation about Upload Permissions

Include some informations about how to make sure the current user has upload permissions (by wrapping the MediaUpload component into the MediaUploadCheck one)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] File Affects the File Block [Feature] Drag and Drop Drag and drop functionality when working with blocks [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants