-
Notifications
You must be signed in to change notification settings - Fork 815
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
Fix block exception throw in Site Editor #33350
Conversation
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Not urgent as I know this is supposed to be a hotfix! However, if you could update the description later to better explain why this happened and how it's is being solved, it'd be great :) Thank you! |
5e384a1
to
576527c
Compare
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.
Due to some technical issues I can't check it locally, however, changes look reasonable to me. Just to unblock I'm approving this PR, but if it waits until some time tomorrow, it could be additionally tested...
Fixes Automattic/wp-calypso#82023
Proposed changes:
Some recently refactored blocks (Business Hours and beta blocks) caused the following exception to be thrown in the site editor.

In the refactoring, moving the title from the
settings
argument passed toregisterJetpackBlock
to ablock.json
metadata file caused the title to be undefined in the callback of theblocks.registerBlockType
filter hook. This PR fixes this by adding guards in the callback to prevent undefined settings from calling methods.While this prevents the above exception, the
The block "jetpack/block-name" must have a title.
errors can be seen in the console. However, this doesn't seem to affect how blocks are rendered and behave, and blocks can be searched by their name in the block inserter.Other information:
Jetpack product discussion
n/a
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
wp-admin/site-editor.php?canvas=edit
.