Make WordPress Core

Opened 8 months ago

Closed 7 months ago

Last modified 2 months ago

#61342 closed defect (bug) (fixed)

Bundled block themes: The theme.json schema version is incorrect

Reported by: poena's profile poena Owned by: audrasjb's profile audrasjb
Milestone: 6.6 Priority: high
Severity: normal Version: 6.6
Component: Bundled Theme Keywords: has-patch commit
Focuses: Cc:

Description

Both Twenty Twenty-Two, Twenty Twenty-Three, and Twenty Twenty-Four uses
"$schema": "https://schemas.wp.org/trunk/theme.json", in theme.json.

However, trunk is the development version.
Because this schema has already been updated in preparation for the theme.json version bump from 2 to 3 in WordPress 6.6, code editors show parts of theme.json as invalid.

The themes need to use the version of theme.json that was valid when the theme was released.

Documentation:
https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/theme-json-v2/#json-schema

The last schema for version 2 is available at https://schemas.wp.org/wp/6.5/theme.json.

Change History (17)

#1 follow-up: @sabernhardt
8 months ago

  • Keywords needs-patch added
  • Priority changed from normal to high
  • Version set to trunk

The three bundled themes will need correcting, but more than 300 other themes might break with the version bump because they followed our example.

#2 @wildworks
8 months ago

I remember this issue being discussed in the PR where the theme.json version was bumped up to 3 on the Gutenberg plugin (See this comment: https://github.com/WordPress/gutenberg/pull/58409#discussion_r1584277338).

@ajlende do you have any good ideas to deal with this issue?

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


8 months ago
#3

  • Keywords has-patch added; needs-patch removed

#4 @poena
8 months ago

Testing instructions

Apply the PR and open the theme.json files in a code editor that supports using the schema for validation. There should be no problems reported.

#5 in reply to: ↑ 1 @poena
8 months ago

Replying to sabernhardt:

The three bundled themes will need correcting, but more than 300 other themes might break with the version bump because they followed our example.

It is only the validation of the file, when it is viewed in a supported code editor, that shows incorrect warnings. The theme does not break in other ways.

#6 follow-up: @mukesh27
8 months ago

Q: Do we needs to update the WP version based on release in theme.json?

#7 in reply to: ↑ 6 @poena
8 months ago

Replying to mukesh27:

Q: Do we needs to update the WP version based on release in theme.json?

I am not sure I understand the question.
Are you asking if Twenty Twenty-Two, that has a minimum required WP version of 5.9,
should have https://schemas.wp.org/wp/5.9/theme.json?

I don't think so.
Version 2 of theme.json is used from WordPress 5.9 to 6.5.
There are no breaking changes in version 2, only new features added in different WordPress versions.
Using the 5.9 schema would show that appearanceTools and FontFace are not valid.

#9 @hmbashar
8 months ago

  • Keywords needs-testing added

#10 @kafleg
7 months ago

Thank you for making the ticket @poena

I tested by changing it and the issue was gone. :)

I changed trunk to wp/6.5 in this line "$schema": "https://schemas.wp.org/wp/6.5/theme.json",

Thank you

#11 @audrasjb
7 months ago

  • Keywords commit added; needs-testing removed
  • Owner set to audrasjb
  • Status changed from new to accepted

The PR looks good to me too.
Marking for commit.

#12 @audrasjb
7 months ago

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

In 58403:

Bundled block themes: Set theme.json schema version to 6.5.

This changeset updates the theme.json schema version from trunk which is the development version to the last schema for version 2 available at https://schemas.wp.org/wp/6.5/theme.json.

Props poena, sabernhardt, wildworks, mukesh27, kafleg.
Fixes #61342.

This ticket was mentioned in Slack in #core-themes by poena. View the logs.


6 months ago

#16 @karmatosed
6 months ago

@poena I feel like creating a new ticket makes sense as this one has passed but also wouldn't fight it being reopened.

This ticket was mentioned in Slack in #core-editor by poena. View the logs.


2 months ago

Note: See TracTickets for help on using tickets.