#61342 closed defect (bug) (fixed)
Bundled block themes: The theme.json schema version is incorrect
Reported by: | poena | Owned by: | 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:
↓ 5
@
8 months ago
- Keywords needs-patch added
- Priority changed from normal to high
- Version set to trunk
#2
@
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
Trac ticket:
https://core.trac.wordpress.org/ticket/61342
#4
@
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
@
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:
↓ 7
@
8 months ago
Q: Do we needs to update the WP version based on release in theme.json?
#7
in reply to:
↑ 6
@
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.
#10
@
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
@
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
.
@audrasjb commented on PR #6711:
7 months ago
#13
committed in https://core.trac.wordpress.org/changeset/58403
#14
@
6 months ago
The schema was not update in the style variation files.
In Twenty Twenty-Two, the schema is missing:
https://core.trac.wordpress.org/browser/branches/6.6/src/wp-content/themes/twentytwentytwo/styles/blue.json
In Twenty Twenty-Three and four, the schema version is trunk:
https://core.trac.wordpress.org/browser/branches/6.6/src/wp-content/themes/twentytwentythree/styles/aubergine.json
Can this ticket be reopened or do I need to create a new?
This ticket was mentioned in Slack in #core-themes by poena. View the logs.
6 months ago
#16
@
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.
The three bundled themes will need correcting, but more than 300 other themes might break with the version bump because they followed our example.