-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
PHP: Backport changes from core theme resolver. #46250
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @spacedmonkey!
@@ -34,11 +34,15 @@ public static function get_theme_data( $deprecated = array(), $settings = array( | |||
} | |||
|
|||
// When backporting to core, remove the instanceof Gutenberg class check, as it is only required for the Gutenberg plugin. | |||
if ( null === static::$theme || ! static::$theme instanceof WP_Theme_JSON_Gutenberg ) { | |||
if ( null === static::$theme || ! static::has_same_registered_blocks( 'theme' ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why there is the check for static::$theme instanceof WP_Theme_JSON_Gutenberg
, though we should aim to understand that before removing it. What was the intention behind it? Is it safe to remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is this way in core. This just a back port.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spacedmonkey I've looked up git history and that check has been added in this PR #42756
As my understanding goes, without that check, there's an issue with some data not being recalculated in the plugin, so this PR has introduced a regression.
I am working on something that will fix the root issue (re: reorganizing theem.json code in the plugin), though, in the meantime, this is just such a small change that is worth adding it back until that lands.
Hi 👋 This may be a stupid question, but my wp-env is broken after this commit. Is there something I need to do to make it work? For example, when I run error
With the previous commit, it works fine. |
Never mind, a complete wipe fixed it ( |
|
* Backport changes from core. * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review * Add line back. * Fix lint
Btw, I think this fixed it because it would have updated the WordPress source code, which introduces the missing properties that caused the crash! :) You can also run |
I have to think there was something else involved because the |
I just had the exact same error myself trying to run |
What?
Backport changes from WordPress/wordpress-develop@8368eef by @felixarntz
Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast