Making WordPress.org

Opened 12 months ago

Closed 8 weeks ago

#7037 closed defect (bug) (fixed)

Image upload issue on support comment box

Reported by: sumitsingh's profile 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)

How-to-remove-the-donate-button-in-a-plugin-page-WordPress-org.png (119.5 KB) - added by sumitsingh 12 months ago.
message going in footer
How-to-remove-the-donate-button-in-a-plugin-page-WordPress-org (1).png (105.4 KB) - added by sumitsingh 12 months ago.
Broekn image
How-to-remove-the-donate-button-in-a-plugin-page-WordPress-org (2).png (100.5 KB) - added by sumitsingh 12 months ago.
I can see white space in footer

Download all attachments as: .zip

Change History (11)

#1 @sumitsingh
12 months ago

  • Milestone Q1 deleted

#2 @dd32
12 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 @sumitsingh
12 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 @sumitsingh
12 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 @Otto42
12 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.

Last edited 12 months ago by Otto42 (previous) (diff)

#6 @sumitsingh
12 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 @dd32
12 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.

#8 @dd32
8 weeks ago

  • Resolution set to fixed
  • Status changed from new to closed

Looks like it's not possible to attempt uploading images anymore, and pasting images doesn't work either.

Note: See TracTickets for help on using tickets.