PHP: Backport changes from core theme resolver.#46250
Conversation
|
|
||
| // 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.
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.
It is this way in core. This just a back port.
There was a problem hiding this comment.
@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 errorWith 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