Make WordPress Core

Opened 3 years ago

Closed 3 weeks ago

#55410 closed enhancement (worksforme)

Update spacer block markup in patterns/templates registered by Twenty Twenty-Two and Core

Reported by: jsnajdr's profile jsnajdr Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 6.0
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description

The Twenty Twenty-Two theme registers block patterns and templates that contain deprecated markup for core/spacer blocks. They specify height attribute as a number ("height":50) instead of a string that includes units ("height":"50px"). Because of that, the block parser reports depreciation messages in browser console.

The attached patch updates markup of block patterns and templates registered by modules that don't need to be compatible with pre-5.9 WordPress: the Twenty Twenty-Two theme and Core itself.

Change History (5)

This ticket was mentioned in PR #2422 on WordPress/wordpress-develop by jsnajdr.


3 years ago
#1

The Twenty Twenty-Two theme registers block patterns and templates that contain deprecated markup for core/spacer blocks. They specify height attribute as a number ("height":50) instead of a string that includes units ("height":"50px"). Because of that, the block parser reports a lot of depreciations in browser console, like:

https://i0.wp.com/user-images.githubusercontent.com/664258/158774209-fa4fe6fc-1573-40c7-95b7-f2520510d856.png

The spacer format change was introduced in this PR: https://github.com/WordPress/gutenberg/pull/36186

I'm also updating the core/query-offset-posts pattern registered by Core itself, not by a theme. And one instance of core/cover block which also had deprecated markup.

I'm updating only code that doesn't support WordPress versions older than 5.9, i.e., Core and the Twenty Twenty-Two theme. Other themes, like Twenty Thirteen, also register patterns with deprecated markup, but these also support older versions of WordPress, which wouldn't be able to parse the new format.

Fixes https://core.trac.wordpress.org/ticket/55410

#2 @karmatosed
12 months ago

  • Keywords needs-testing added
  • Milestone changed from Awaiting Review to Future Release

#3 @karmatosed
10 months ago

  • Owner set to karmatosed
  • Status changed from new to assigned

Assigning to myself for testing, thank you.

#4 @karmatosed
10 months ago

  • Owner karmatosed deleted

#5 @SirLouen
3 weeks ago

  • Keywords needs-testing removed
  • Resolution set to worksforme
  • Status changed from assigned to closed

Reproduction Report

Description

❌ This report can't validate that the issue can be reproduced.

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.28
  • Server: nginx/1.27.5
  • Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
  • Browser: Chrome 136.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Two 2.0
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Bug Reproduction Steps

  1. Enable 2022 theme
  2. Open a new page
  3. Add a template > Footers > Footer with social links and copyright
  4. ❌ Nothing happens

Actual Results

  1. ❌ Error condition doesn't occur

Additional Notes

Hello @jsnajdr, I've noted that if I add a spacer and remove the px in code, the deprecation notice appears as you suggest.

But I've been trying to add several patterns and I can't seem to find one that triggers this notice
I've checked your PR and added some templates (without the patch) that you seem to be touching like footer-navigation-coypright.php and none seem to trigger the deprecation notice

For example, one of the templates you touch is "footer with social links and copyright" but the pixels are automatically added

Maybe since 3 years have passed since you opened this, this has been already sorted at some point

This said, I can close this as worksforme. You are welcome to reopen if you can provide some exact reproduction steps that I could have missed.

Note: See TracTickets for help on using tickets.