-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Site Editor: Export includes layout definitions from lib/theme.json #50238
Comments
Question: Do these definitions need to be part of the core theme.json at all? Since they relate to core layout and should never be customized or exported, shouldn't they live elsewhere? |
Note that this seems to be addressed in the current branch of WordPress 6.3 (regardless of Gutenberg plugin usage). A quick scan wasn't able to show me what changed in core to make this work as expected. |
Thanks for opening up this issue and for the detailed description of the problem! I believe this was a regression introduced in #48070 — it appears that change accidentally included all of the layout object when making changes to I have a fix open in #50268 which strips the
That's a good question. When they were introduced into the core As for next steps, assuming #50268 is a good enough fix for now, that should solve the immediate issue. If we need to harden it further, then a next step could be to see if we can update the getters for merged theme.json data so that the layout definitions are always pulled from the |
Extracting from WordPress/create-block-theme#324 (comment), and related to #49914 with further context in #49914 (comment).
When you build a theme in the site editor, then export it using the ellipsis > Export option, the theme.json file includes
settings.layout.definitions
in the export.These definitions should only ever be in the core theme.json, as they are used to build the core styles for each layout type. They should never be in theme files, as they are now. #49914 is an example of what can happen when they are included, that is: any bugs present in the layout definitions when the theme was exported get permanently applied to the theme, since those definitions override the core definitions. Additional results could be that any new features applied to layout in newer versions of theme.json will invisibly fail or just not work.
Steps to reproduce:
Observe how it includes all definitions copied over from lib/theme.json.
This is urgently in need of fixing, lest every theme created until fixed, will have hard-to-debug future layout issues.
The text was updated successfully, but these errors were encountered: