Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template Part Editor broken after updating to WordPress 6.1.1 #45862

Closed
fabiankaegy opened this issue Nov 17, 2022 · 7 comments · Fixed by #46073
Closed

Template Part Editor broken after updating to WordPress 6.1.1 #45862

fabiankaegy opened this issue Nov 17, 2022 · 7 comments · Fixed by #46073
Assignees
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Priority] High Used to indicate top priority items that need quick attention [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release

Comments

@fabiankaegy
Copy link
Member

After updating to WordPress 6.1.1 the Block Based Template Editor is loading just a blank white screen. No console error or anything.

This issue was originally reported on the make blog https://make.wordpress.org/core/2022/10/04/block-based-template-parts-in-traditional-themes/#comment-44097

@Mamaduka was successfully able to replicate this issue and has narrowed it down to the changes that were made in https://core.trac.wordpress.org/ticket/56945 specifically the lines here: https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/class-wp-theme-json-resolver.php#L423-L425

The issue happens on both WordPress 6.1.1 without any plugins and also with Gutenberg trunk.

@fabiankaegy fabiankaegy added [Type] Bug An existing feature does not function as intended [Priority] High Used to indicate top priority items that need quick attention [Type] Regression Related to a regression in the latest release [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Nov 17, 2022
@fabiankaegy
Copy link
Member Author

I'm not sure whether this should be tracked in trac or here in GitHub. So feel free to move over as needed.

@fabiankaegy
Copy link
Member Author

Props: karks88, jeffmcnear, and maurodf for reporting this

@Mamaduka
Copy link
Member

Adding a simple theme.json file should resolve the issue for now. This is a temporary solution before shipping the fix in the next WP release.

P.S. I would recommend using the theme.json file for the classic themes that have this feature enabled, at least to define the layout. You find a great example by @justintadlock here - https://gutenbergtimes.com/building-a-block-based-header-template-in-a-classic-theme/#2-adding-theme-json-support.

Example theme.json

{
	"version": 2,
	"settings": {}
}

@fabiankaegy
Copy link
Member Author

Thanks @Mamaduka 😀

I do just want to note that adding a theme.json file comes with a few side effects that may surprise someone. For example the inner container div of the group block gets removed which can cause some issues if custom styling depended on the presence of that.

@maurodf0
Copy link

Thanks @Mamaduka i thought that was a releated theme.json problem cause the others users using this feature included the theme.json into their theme and commented with no problem at all.

Tested in my site and all works fine, even with empty theme.json file.

@Mamaduka Mamaduka changed the title REGRESSION: Template Part Editor broken after updating to WordPress 6.1.1 Template Part Editor broken after updating to WordPress 6.1.1 Nov 18, 2022
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Nov 25, 2022
@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label Nov 30, 2022
@ottomen
Copy link

ottomen commented Dec 17, 2022

Could you be so kind to say, what is the target folded for the theme.json, please?

@mrwweb
Copy link

mrwweb commented Mar 8, 2023

@ottomen If you didn't figure it out yet, theme.json goes in the root of the active theme, e.g. wp-content/themes/{your theme folder}/theme.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Priority] High Used to indicate top priority items that need quick attention [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants