Wp-calypso: Block Editor: Edit Image option missing on image block

Created on 13 Dec 2019  路  6Comments  路  Source: Automattic/wp-calypso

Steps to reproduce

  1. Starting at URL: https://wordpress.com/block-editor/page/ or https://wordpress.com/block-editor/post
  2. Add an Image blog and add an image (method should not matter)
  3. There is no Edit Image option:

edit-image

Instead it seems to have been replaced by Replace text with a dropdown:

Screen Shot 2019-12-13 at 2 10 06 PM

What I expected

To be able to edit an inserted image.

What happened instead

Without the Edit Image button there is no easy way to modify an already inserted image. On Atomic/core it looks like these have moved to Crop Settings in the sidebar but maybe due to our custom library we haven't brought that over?

Screen Shot 2019-12-13 at 2 13 20 PM

Context / Source

2559723-zd - The user reported this changed in the last 24 hours

Blocks [Goal] Gutenberg [Type] Bug

All 6 comments

Thanks @kriskarkoski for the report! There's a current awkward workaround, with replace > media modal, select an image then click edit, but it's not great.

@apeatling @olaolusoga any thoughts on how we should adapt this in our integration?

The crop settings are from the full CoBlocks plugin. We whitelist a subset of blocks on Simple Sites so this is the reason why we don't see this in the sidebar.

One option might be to see if this extension is safe to include the CoBlocks crop extension, another option would be to add back an edit button, but this could be more fragile if it's a wpcom only customization.

Thanks for clarifying where the Crop Settings were coming from!

It looks like this would be the related core Gutenberg issue for adding support for in-editor cropping: https://github.com/WordPress/gutenberg/issues/13748

@kriskarkoski From memory the "edit image" button previously on blocks was never really an option to edit the image, it only opened the media library for the option to edit from there or replace. So really, this change just renamed the option to what it really does. So yes, this would be a core issue.

I didn't use this much recently so I can't recall the previous behavior, but it looks like the main difference now is when you open the library on our version no image is selected, where on core the current image is shown and you can click Edit without needing to find it again:

Screen Shot 2019-12-16 at 8 01 34 AM

Clicking Edit opens this:

Screen Shot 2019-12-16 at 8 01 43 AM

I'll leave it up to @gwwar and team if we want to keep this issue open on our side given this difference or wait for https://github.com/WordPress/gutenberg/issues/13748 to be addressed.

where on core the current image is shown and you can click Edit without needing to find it again:

I get a different behavior than this. Actually, I get the same behavior as currently in WP.com: the core media modal shows up without any image selected, which matches with what I found on the code (the id of the current image is not passed to the MediaUpload component).

@kriskarkoski Maybe you're using the block editor bundled in WP core rather than the Gutenberg plugin? WP 5.3.2 doesn't not include yet the changes from https://github.com/WordPress/gutenberg/pull/16200, so the "Edit" button has not been changed yet to "Replace" and therefore, it relies on the _old_ flow that passes the current image id to the the MediaUpload component.

This is being worked on in core at https://github.com/WordPress/gutenberg/pull/20637. Marking this issue as closed as we'll get the core improvement soon enough.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cpapazoglou picture cpapazoglou  路  64Comments

vindl picture vindl  路  48Comments

serabi picture serabi  路  66Comments

AMcGrady picture AMcGrady  路  62Comments

supernovia picture supernovia  路  49Comments