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

Gallery block: Block is broken when returning from HTML edit mode to visual edit mode #39310

Closed
t-hamano opened this issue Mar 9, 2022 · 3 comments · Fixed by #39318
Closed
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Type] Bug An existing feature does not function as intended

Comments

@t-hamano
Copy link
Contributor

t-hamano commented Mar 9, 2022

Description

In the new gallery block, when I select "Edit as HTML" and press the "Option" button, the block is broken.

I think that HTML editing should be prohibited in blocks that have child blocks (such as column blocks and group blocks).
But HTML editing is not prohibited in v1 gallery block, so the process should be switched between v1 / v2.

I found something even stranger, when I tried to resolve block , one of the comment delimiters in the image block was wp:fimage instead of wp:image.

captrue

Step-by-step reproduction instructions

  1. Insert gallery block.
  2. Select images or upload images.
  3. Insert the gallery without any particular editing.
  4. Select "Edit as HTML" from Block Toolbar Option.
  5. Do not edit the HTML, and press the option button shown in the upper left corner of the block.

Screenshots, screen recording, code snippet

9528d150b733a3ebacced0f8baddd2c6.mp4

Environment info

  • WordPress version: 5.9.1
  • Gutenberg version: latest(12.7.1)
  • Browser: Google Chrome 99.0.4844.51
  • OS:Windows 11

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Block] Gallery Affects the Gallery Block - used to display groups of images labels Mar 9, 2022
@t-hamano t-hamano changed the title Gallery block: Blocks are broken when "Edit as HTML" Gallery block: Block is broken when returning from HTML edit mode to visual edit mode Mar 9, 2022
@Mamaduka
Copy link
Member

Mamaduka commented Mar 9, 2022

It makes sense to disable HTML editing for Gallery v2, and I think we only need to declare "html": false in block supports.

@t-hamano
Copy link
Contributor Author

t-hamano commented Mar 9, 2022

@Mamaduka

Since the gallery block is automatically migrated from v1 to v2, should I simply add html:false without considering v1?
If so, I would like to send a pull request 👍

@Mamaduka
Copy link
Member

Mamaduka commented Mar 9, 2022

Correct, just add html: false to the block.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants