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

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

Closed
lakeme opened this issue Apr 4, 2023 · 2 comments · Fixed by #51288
Assignees
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability [Feature] Block Validation/Deprecation Handling block validation to determine accuracy and deprecation [Type] Bug An existing feature does not function as intended

Comments

@lakeme
Copy link

lakeme commented Apr 4, 2023

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

@lakeme lakeme changed the title Updating from 14.9.1 to 15.4.0, resolvable validation errors because of anchors / id attributes Updating from 14.9.1 to 15.4.0, unresolvable validation errors because of anchors / id attributes Apr 4, 2023
@kathrynwp kathrynwp added [Feature] Block Validation/Deprecation Handling block validation to determine accuracy and deprecation [Type] Bug An existing feature does not function as intended labels Apr 4, 2023
@t-hamano
Copy link
Contributor

t-hamano commented Apr 5, 2023

@lakeme

Thank you for the report.

This problem should occur in all blocks that want to support the anchor. The same problem was reported in #48232 and a fix is being attempted in #48232.

@t-hamano t-hamano self-assigned this Apr 5, 2023
@t-hamano t-hamano added [Status] In Progress Tracking issues with work in progress Backwards Compatibility Issues or PRs that impact backwards compatability labels Apr 5, 2023
@t-hamano
Copy link
Contributor

Hi @lakeme,

This issue is due to the dynamic block anchor support added on the Gutenberg plugin. We have removed this feature from the Gutenberg plugin so this issue will not occur.

Instead, I have submitted #51402 to consider re-adding anchor support to dynamic blocks,

@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability [Feature] Block Validation/Deprecation Handling block validation to determine accuracy and deprecation [Type] Bug An existing feature does not function as intended
Projects
None yet
4 participants