Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#59472 closed defect (bug) (fixed)

Beta 1: Edit post shows block validation failed for `core/heading`

Reported by: mukesh27's profile mukesh27 Owned by:
Milestone: 6.4 Priority: normal
Severity: normal Version: 6.4
Component: Bundled Theme Keywords: needs-testing has-patch
Focuses: administration Cc:

Description

The beta1 shows jQuery error in browser console.

Error:

blocks.min.js?ver=6dacee963fadc2f97b48:10 Block validation: Block validation failed for `core/heading` ({name: 'core/heading', icon: {…}, keywords: Array(2), attributes: {…}, providesContext: {…}, …}).

Content generated by `save` function:

<h2 class="wp-block-heading screen-reader-text">Posts</h2>

Content retrieved from post body:

<h1 class="wp-block-heading screen-reader-text">Posts</h1>

Check attached screenshot for more info.

Attachments (2)

Error.png (294.9 KB) - added by mukesh27 2 years ago.
console_error.jpg (357.3 KB) - added by kafleg 2 years ago.

Download all attachments as: .zip

Change History (14)

@mukesh27
2 years ago

@kafleg
2 years ago

#1 @kafleg
2 years ago

The above screenshot is from Microsoft edge, but WordPress version is 6.3.1

Last edited 2 years ago by kafleg (previous) (diff)

#2 @andrewserong
2 years ago

I wonder where this is coming from? I can see the warning, too. If I manually copy in markup that includes the block comment specifying the correct heading level, it seems to work okay for me in 6.4:

<!-- wp:heading {"level":1,"className":"screen-reader-text"} -->
<h1 class="wp-block-heading screen-reader-text">Posts</h1>
<!-- /wp:heading -->

Could there be a block pattern (or preview) somewhere that has illegal markup or is missing the level in the block comment delimiter?

#3 @poena
2 years ago

  • Component changed from Editor to Bundled Theme

Hi!
This is a known problem with the markup in the theme Twenty Twenty-Four, not the editor component. Luckily, there is already a pull request merged for this in the Twenty Twenty-Four GitHub repository.
It will be resolved next time the theme files are updated with the changes from GitHub.

Last edited 2 years ago by poena (previous) (diff)

#4 @poena
2 years ago

This was also discussed on Slack, and decided to be non-blocking for 6.4 Beta 1 during the so called "release party".

An account is needed to read the conversation:
https://wordpress.slack.com/archives/C02RQBWTW/p1695756022664579

Last edited 2 years ago by poena (previous) (diff)

#5 @mukesh27
2 years ago

Thanks @poena for details. Could you please share the tracking issue?

#6 @mukesh27
2 years ago

  • Summary changed from Beta 1: Edit post shows block validation failed for `core/heading` to Bundled Theme: In Twenty Twenty-Four edit post shows block validation failed for `core/heading`

#7 @poena
2 years ago

  • Summary changed from Bundled Theme: In Twenty Twenty-Four edit post shows block validation failed for `core/heading` to Beta 1: Edit post shows block validation failed for `core/heading`

I am not aware of a tracking issue for updating Twenty Twenty-Four.

#8 @poena
2 years ago

Sorry I did not intend to change the Summary, we just happened to be editing at the same time.

This ticket was mentioned in PR #5328 on WordPress/wordpress-develop by @andrewserong.


2 years ago
#9

  • Keywords has-patch added; needs-patch removed

Fix broken markup for Portfolio Index Template pattern in TT4, which appears to be the cause of a validation error in the console when opening the post editor.

Trac ticket: https://core.trac.wordpress.org/ticket/59472

To test, prior to applying this PR, you should see an error in the console:

https://i0.wp.com/github.com/WordPress/wordpress-develop/assets/14988353/5de18e83-ac03-4c67-98a8-81d280b97223

With this PR applied, after reloading the editor, the error should no longer appear. If you wish to double-check the pattern renders correctly, it can be viewed within the Patterns page in the site editor: /wp-admin/site-editor.php?path=%2Fpatterns — then filter by portfolio index in the search field to see the preview of that pattern. The full URL if running the Docker-based local testing environment is: http://localhost:8889/wp-admin/site-editor.php?path=%2Fpatterns

#10 @andrewserong
2 years ago

Apologies I missed the discussion here before opening the PR. Feel free to ignore that PR if you have a sync process that will overwrite it. Thank you!

#11 @hellofromTonya
2 years ago

  • Milestone changed from Awaiting Review to 6.4
  • Resolution set to fixed
  • Status changed from new to closed

Hello all,

Thank you for reporting this issue.

I happened to find it yesterday too before the release party started. It only happened with TT4. Switching to TT3 resolved it.

As @poena noted, there is a fix that has already been merged into the TT4 GitHub repo:

https://github.com/WordPress/twentytwentyfour/pull/500

That fix will be part of the theme update that gets committed into Core ahead of 6.4 Beta 2 release.

As this issue is resolved, I'll close this ticket as fixed.

@andrewserong commented on PR #5328:


2 years ago
#12

I'll close out this linked PR, as the issue will be fixed once https://github.com/WordPress/twentytwentyfour/pull/500/ is merged into core. Thanks folks!

Note: See TracTickets for help on using tickets.