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

Attempt to assign property "content" on null in compat/wordpress-6.6/resolve-patterns.php #60638

Closed
jeremyfelt opened this issue Apr 10, 2024 · 1 comment
Labels
[Type] Bug An existing feature does not function as intended

Comments

@jeremyfelt
Copy link
Member

jeremyfelt commented Apr 10, 2024

Description

In Gutenberg 18.1.0, get_block_template is filtered with gutenberg_replace_pattern_blocks_get_block_template(), which is looking for a full WP_Block_Template object.

It is possible for null to be passed to the get_block_template filter instead. When this happens, a fatal error occurs because Gutenberg attempts to read/assign the content property.

Step-by-step reproduction instructions

Sorry, I'm mid-launch on something, so I can't spend much time on this part. But I'll loop back soon.

But, in a situation where get_block_file_template() returns null for a template during get_block_template(), that null will be passed to get_block_template.

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 6.5, Gutenberg 18.1.0

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

No

@jeremyfelt jeremyfelt added the [Type] Bug An existing feature does not function as intended label Apr 10, 2024
@jeremyfelt
Copy link
Member Author

Ugh, I just realized a fix for this is already in trunk. Sorry for the noise, but hoping that's a quick .1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

1 participant