Description
After upgrading to version 15.1 of the Gutenberg plugin, core/group blocks with HTML anchors lose all their inner blocks upon saving the editor.
Step-by-step reproduction instructions
- Add a
core/group block to a page using Gutenberg 15.0.1 or earlier.
- Add a few inner blocks to that group block.
- Set an HTML anchor to that group block.
- Upgrade to Gutenberg 15.1 or newer.
- Open the editor containing said group block and click on
Update.
- Refresh the editor and/or the page itself. The inner blocks are now gone.
Screenshots, screen recording, code snippet
Here is an example of the post_content value in the database for a test page created with Gutenberg 15.0.1:
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div id="my-test-group-anchor" class="wp-block-group"><!-- wp:heading -->
<h2 class="wp-block-heading">Heading inside group</h2>
<!-- /wp:heading --></div>
<!-- /wp:group -->
<!-- wp:heading -->
<h2 class="wp-block-heading" id="my-test-heading-anchor">Heading with anchor</h2>
<!-- /wp:heading -->
The page content itself looks like this: https://d.pr/i/hxLPJT
After upgrading to Gutenberg 15.1 (confirmed also with 15.1.1), when opening the page in the editor, there are these two entries in the console log: https://d.pr/i/vRLLLY
If I change nothing on the page but simply click on Update, the page content will look like this: https://d.pr/i/7CSZjO (no more Heading inside group).
If I then reload the Gutenberg editor for that page, there is this error in the console log: https://d.pr/i/3v0uBI and the group itself looks like this: https://d.pr/i/OLUPsU
The post_content value in the database is now:
<!-- wp:group {"layout":{"type":"constrained"}} /-->
<!-- wp:heading {"className":"wp-block-heading","anchor":"my-test-heading-anchor"} -->
<h2 class="wp-block-heading" id="my-test-heading-anchor">Heading with anchor</h2>
<!-- /wp:heading -->
Environment info
No response
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
Description
After upgrading to version 15.1 of the Gutenberg plugin,
core/groupblocks with HTML anchors lose all their inner blocks upon saving the editor.Step-by-step reproduction instructions
core/groupblock to a page using Gutenberg 15.0.1 or earlier.Update.Screenshots, screen recording, code snippet
Here is an example of the
post_contentvalue in the database for a test page created with Gutenberg 15.0.1:The page content itself looks like this: https://d.pr/i/hxLPJT
After upgrading to Gutenberg 15.1 (confirmed also with 15.1.1), when opening the page in the editor, there are these two entries in the console log: https://d.pr/i/vRLLLY
If I change nothing on the page but simply click on
Update, the page content will look like this: https://d.pr/i/7CSZjO (no moreHeading inside group).If I then reload the Gutenberg editor for that page, there is this error in the console log: https://d.pr/i/3v0uBI and the group itself looks like this: https://d.pr/i/OLUPsU
The
post_contentvalue in the database is now:Environment info
No response
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