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

Create-block-interactive-template: Prevent crash when Gutenberg plugin is not installed #56941

Conversation

luisherranz
Copy link
Member

What?

This prevents a crash when you scaffold a project using the @wordpress/create-block-interactive-template and Gutenberg is not installed yet.

Why?

Because when Gutenberg is not installed, the gutenberg_*_module functions don't exist yet and it crashes WordPress.

How?

By wrapping those functions in a function_exists clause.

Testing Instructions

  • Scaffold a project using the Getting started guide.
  • Run WordPress using wp-now start.
  • Open the site.
  • It should not crash and you should be able to install Gutenberg.

@luisherranz luisherranz added [Type] Bug An existing feature does not function as intended [Tool] Create Block /packages/create-block labels Dec 11, 2023
@luisherranz luisherranz self-assigned this Dec 11, 2023
@luisherranz luisherranz enabled auto-merge (squash) December 11, 2023 12:41
Copy link

github-actions bot commented Dec 11, 2023

Flaky tests detected in 53f0933.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7167561143
📝 Reported issues:

@luisherranz luisherranz merged commit 22c7c16 into trunk Dec 11, 2023
51 checks passed
@luisherranz luisherranz deleted the fix/create-block-interactive-template-fix-gutenberg-not-installed branch December 11, 2023 13:10
@github-actions github-actions bot added this to the Gutenberg 17.3 milestone Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Tool] Create Block /packages/create-block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants