Skip to content

Updating from 14.9.1 to 15.4.0, unresolvable validation errors because of anchors / id attributes #49578

@lakeme

Description

@lakeme

Description

After updating from Gutenberg 14.9.1 to 15.4.0 I get a bunch of 'unresolvable' validation failed errors. Unfortunately the logs in the console were not helpful at all.
After some investigation I found out that the validation errors come from simple anchor tags.
In Gutenberg 14.9.1 when adding an anchor tag to a block this results in

Gutenberg 14.9.1

<!-- wp:group {"backgroundColor":"tertiary","layout":{"type":"constrained"}} -->
<div id="test" class="wp-block-group has-tertiary-background-color has-background"><!-- wp:heading -->
<h2 class="wp-block-heading">Test</h2>
<!-- /wp:heading --></div>
<!-- /wp:group -->

When I paste this code into an editor with Gutenberg v.15.4.0 this results in one of these
'unresolvable' validation failed errors (after a reload)
I found that that is simply because of the missing "anchor": "test" in the attributes.

Gutenberg v.15.4.0

<!-- wp:group {"align":"wide","backgroundColor":"tertiary","layout":{"type":"constrained"},"anchor":"test"} -->
<div class="wp-block-group alignwide has-tertiary-background-color has-background" id="test"><!-- wp:heading -->
<h2 class="wp-block-heading">Test</h2>
<!-- /wp:heading --></div>
<!-- /wp:group -->

That is an annoying situation since that does not only removes the anchor tags but also
requires to redo all the editing again.

Step-by-step reproduction instructions

  1. wp plugin install gutenberg --version=14.9.1 --force
  2. add a group block with an anchor tag / HTML Anchor and some child blocks inside
  3. copy the block markup
  4. wp plugin update gutenberg (update to 15.4.0)
  5. paste block markup, save and reload site, check console

Screenshots, screen recording, code snippet

image

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.

No

Metadata

Metadata

Assignees

Labels

Backwards CompatibilityIssues or PRs that impact backwards compatability[Feature] Block Validation/DeprecationHandling block validation to determine accuracy and deprecation[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions