Open jeyip opened 3 years ago
Apparently the global styles feature also relies on a custom post type that uses theme stylesheet pathing (similar to how FSE template / parts do).
get_user_data()
is invoked ( Link )get_user_data()
is defined here in the file ( Link )get_user_data()
calls get_user_data_from_custom_post_type()
( Link ) get_user_data_from_custom_post_type()
finds and returns a CPT related to Global Styles ( Link )get_user_data_from_custom_post_type()
attempts to query for an existing CPT by name. ( Link ) wp_get_theme()->get_stylesheet()
for $post_name_filter
pub
(Ex. pub/tt1-blocks
). This is because themes are nested in a pub
subdirectory. After an atomic migration, however, the theme's stylesheet changes. Block themes are relocated outside of the pub
subdirectory, and the stylesheet is no longer prefixed by pub
(Ex. tt1-blocks
)get_user_data()
( Link ) get_user_data()
returns an array ( Link )get_raw_data()
is passed an array instead of a WP_Theme_Json object ( Link )https://github.com/WordPress/gutenberg/pull/30088 will help fixing this as well.
https://github.com/WordPress/gutenberg/pull/30088 landed as part of Gutenberg 10.3 and should prevent the site editor from crashing. A different issue, though, is that when users are moved to atomic their user styles aren't going to be pulled because of:
Before an atomic migration, the stylesheet for block-themes is prefixed by pub (Ex. pub/tt1-blocks). This is because themes are nested in a pub subdirectory. After an atomic migration, however, the theme's stylesheet changes. Block themes are relocated outside of the pub subdirectory, and the stylesheet is no longer prefixed by pub (Ex. tt1-blocks)
As you pointed out, the user data is stored as a CPT (post_type = global_styles
and post_name = wp-global-styles-<theme-stylesheet>
see). I wonder how do you do it for user templates, I presume it has the same issue (IIRC, the idea of creating a CPT for user data in global styles was inspired by the templates, but I haven't kept up to how they work).
As you pointed out, the user data is stored as a CPT (post_type = global_styles and post_name = wp-global-styles-
see). I wonder how do you do it for user templates, I presume it has the same issue (IIRC, the idea of creating a CPT for user data in global styles was inspired by the templates, but I haven't kept up to how they work).
For templates and template parts we are saving the theme info in the wp_theme
taxonomy. Would it make sense to align the approaches?
We are going to update these values during atomic transfers/reversals (https://github.com/Automattic/wp-calypso/issues/50659) so it would be much easier if we could query all of the CPTs by taxonomy.
Thanks for the pointer, Marko. I saw you created https://github.com/WordPress/gutenberg/issues/30191 and I added it to the task list for 5.8.
Description
After provisioning an atomic site that is full site editing (FSE) enabled, the site and post editor stop loading upon revisiting either page.
Steps to reproduce the behavior
What I expected to happen
The site editor and page editor load properly for newly created atomic sites
What actually happened
The site throws a critical error
PHP Error Logs
Context
Browser / OS version
Chrome Latest / MacOS Big Sur 11.0.1
Is this specific to the applied theme? Which one?
This only occurs when block themes are enabled (e.g.
tt1-blocks
andseedlet-blocks
)Does this happen on simple or atomic sites or both?
Isolated to atomic sites