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

Blocks using metadata.name on their registration trigger error on PublishPress-Blocks #1366

Open
coutojuli opened this issue Feb 5, 2024 · 0 comments
Labels
unconfirmed bug This needs more testing. Can often be used when a member of the public posts.

Comments

@coutojuli
Copy link

Expected Behavior

PublishPress-Blocks plugin should display blocks independently of their registration method as long as the registration method is available on the WordPress documentation for the used WordPress version.
Docs reference: https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/

Current Behavior

  • If a block is created using npx @wordpress/create-block or manually using the metadata.name registration, PublishPress-Blocks throws an error on the console, doesn't display the block for permission management, making the custom block unavailable.
  • If PublishPress-Blocks plugin is not enabled, the custom block created is available on the editor screen and no errors are thrown on the console.
  • If metadata registration is used instead of metadata.name, PublishPress-Block doesn't throw an error and the block displays on the permision list.

Steps to Reproduce (for bugs)

  1. Create a block using npx @wordpress/create-block https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/
  2. Review the index.js and make sure the registerBlockType is using metadata.name or the block name directly.
  3. Open PublishPress-Blocks Block Permissions on the WP site.
  4. Open the console and check for errors. The error "The block {namespace/block-name} must have a title." appears on the console and the block doesn't appear on the list to be enabled or disabled.

Context

This issue blocks administrators from managing certain blocks depending on their registration method.

Your Environment

Multisite using WPVIP enterprise host.

  • Version used: PHP 8.1 and WordPress 6.3.3 or WordPress 6.4.3
  • Browser Name and version: Chrome
  • Operating System and version (desktop or mobile): MacOS
  • PublishPress-Blocks version: Version 3.2.1
  • Related issue: block.json usage #650
@coutojuli coutojuli added the unconfirmed bug This needs more testing. Can often be used when a member of the public posts. label Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed bug This needs more testing. Can often be used when a member of the public posts.
Projects
None yet
Development

No branches or pull requests

3 participants