Make WordPress Core

Opened 2 months ago

Closed 6 weeks ago

#60530 closed defect (bug) (fixed)

Default privacy policy page not using latest block markup

Reported by: 254volkan's profile 254volkan Owned by: swissspidy's profile swissspidy
Milestone: 6.5 Priority: normal
Severity: trivial Version:
Component: Privacy Keywords: has-patch commit
Focuses: Cc:

Description

There is some info being logged in the console https://i.imgur.com/3h33RE7.png
I was editing the generated privacy policy page wp-admin/post.php?post=5&action=edit.
This has not been replicated when creating a page and trying to edit it.

Attachments (1)

60530.diff (4.3 KB) - added by swissspidy 6 weeks ago.

Download all attachments as: .zip

Change History (8)

#1 @swissspidy
2 months ago

  • Component changed from Administration to Editor
  • Focuses administration removed
  • Keywords has-dev-note removed

#2 @swissspidy
7 weeks ago

  • Version trunk deleted

#3 @skorasaurus
6 weeks ago

  • Resolution set to invalid
  • Status changed from new to closed

Thanks for reporting.

This behavior is intentional and does not mean that anything is broken.

What the message means is that a block's markup has been updated in the post.

When a post or page is saved in WP, the block and its markup is saved.

Over time, a block's markup https://developer.wordpress.org/block-editor/getting-started/fundamentals/markup-representation-block/ may change because bugs are fixed or new features are added in WordPress.

When a page or post is opened in the editor, WP will detect that the old markup is being used and will updated the markup to the new markup automatically and the message appears that the markup was updated.

Since a newly created page automatically uses the latest markup for each block, there is no block markup to be updated; thus no message is displayed.

#4 @swissspidy
6 weeks ago

  • Component changed from Editor to Privacy
  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 6.5
  • Resolution invalid deleted
  • Status changed from closed to reopened

Actually, the Privacy Policy page is a new page, and it doesn't currently use the latest markup.

So the page's content needs to be updated in \WP_Privacy_Policy_Content::get_default_content().

The logged message is:

New content generated by `save` function:

<h2 class="wp-block-heading">Where your data is sent</h2>

Content retrieved from post body:

<h2>Where your data is sent</h2>

So we'll have to turn all the <h2> in that method to <h2 class="wp-block-heading">

@swissspidy
6 weeks ago

#5 @swissspidy
6 weeks ago

  • Keywords commit added
  • Summary changed from Console log showing Updated Block: core/heading to Default privacy policy page not using latest block markup

#6 @swissspidy
6 weeks ago

  • Owner set to swissspidy
  • Status changed from reopened to accepted

#7 @swissspidy
6 weeks ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 57741:

Privacy: Update default privacy page content to use latest block markup.

Avoids “Updated Block” warnings being logged to the console.

Props 254volkan, swissspidy.
Fixes #60530.

Note: See TracTickets for help on using tickets.