Opened 16 months ago
Closed 6 months ago
#7037 closed defect (bug) (fixed)
Image upload issue on support comment box
Reported by: | sumitsingh | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Support Forums | Keywords: | |
Cc: |
Description
Hi,
I have tried to reply to the support ticket with the uploaded image. I can see the image block in the Gutenberg comment box but showing an error message to not able to upload. when I copy and paste an image in the comment box editor then I can see the image in the comment editor, but after the submission, the image looks broken. also notice message going in footer.
For more information, you can see mentioned screenshot.
Attachments (3)
Change History (11)
#2
@
16 months ago
The upload functionality of the block is supposed to be disabled :(
This is likely something that needs resolving upstream in https://github.com/Automattic/blocks-everywhere
I've just submitted a PR to display: none
the upload button, but it might also be that Gutenberg itself has changed and isn't checking for upload caps before showing the button again.
#3
@
16 months ago
May be below the solution for disabling images for subscriber users?
<?php function restrict_comment_block_types($allowed_block_types, $post) { // Check if a user is a subscriber if (current_user_can('subscriber')) { // Remove the "Image" block from the allowed block types $disallowed_blocks = array('core/image'); $allowed_block_types = array_diff($allowed_block_types, $disallowed_blocks); } return $allowed_block_types; } add_filter('allowed_block_types', 'restrict_comment_block_types', 10, 2);
#4
@
16 months ago
Also added a comment on showing a broken image link on this support topic.
https://wordpress.org/support/topic/how-to-remove-the-donate-button-in-a-plugin-page/
#5
@
16 months ago
You are not allowed to upload images. The upload button is not supposed to show up.
Please stop posting such broken images in comments.
#6
@
16 months ago
Hey @Otto42,
Actually, first I have copied the image from the system and pasted into the comment. after submitting the comment I know to broken image and WP is not allowing to upload the image in the comment box.
#7
@
16 months ago
Also added a comment on showing a broken image link on this support topic.
That's another issue, possibly slightly related but also kind of unrelated to the upload issue.
The post_content for the image is an inline image: <img src="image/png;base64,...
- It would've been a src="data:image/...
but the data:
scheme would've been stripped.
It might be worthwhile looking at which parts of this are Gutenberg bugs, which are Blocks Everywhere, and which are WordPress.org-specific.
message going in footer