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

Bug: core/post-content is stripped out of registered patterns blockTypes property for WPCOM sites #98892

Closed
triple0t opened this issue Jan 24, 2025 · 4 comments
Assignees
Labels
[Experiment] AI labels added [Feature] Block Patterns Pattern content itself, and the functionality that lets you create patterns. [Feature Group] Content Management Features related to the tools and screens that admins use to manage their sites core content. [Feature] Plugins Features related to plugins on WordPress.com, including search, management, and installation. Lego Maintenance [Pri] High Address as soon as possible after BLOCKER issues [Status] Auto-allocated [Status] Escalated to Product Ambassadors Triaged To be used when issues have been triaged. [Type] Bug When a feature is broken and / or not performing as intended

Comments

@triple0t
Copy link

triple0t commented Jan 24, 2025

Context and steps to reproduce

See p1737538662329279-slack-C03N25JPCE4 for more information.

Note: The issue does not affect blockTypes set to other blocks e.g., core/paragraph.

Replication
Required

  1. Register a block pattern
  2. Ensure you have blockTypes set on the pattern properties and ensure blockTypes = core/post-content
    e.g
register_block_pattern(
    'my-plugin/powered-by-wordpress',
    array(
        'title'      => __( 'Powered by WordPress', 'my-plugin' ),
        'blockTypes' => array( 'core/post-content' ), // NOTE
        'categories' => array(''),
        'content'    => '<!-- wp:paragraph {"backgroundColor":"black","textColor":"white"} -->
        <p class="has-white-color has-black-background-color has-text-color has-background">Powered by WordPress</p>
        <!-- /wp:paragraph -->',
    )
);

Optional

  • Click on Add new post
  • Open the block inserter,
  • Locate patterns under "Uncategorized" or (the category specified in Step 1 above).
  • Open the Web browser console and run this JS:
wp.data.select('core').getBlockPatterns().filter(( { name } ) => name.includes(`PATTERN_NAME_FROM_STEP_1`) ).
  • Notice that the pattern has the blockType property set to an empty array ([]).

Site owner impact

No response

Severity

No response

What other impact(s) does this issue have?

No response

If a workaround is available, please outline it here.

No response

Platform

Simple

@triple0t triple0t added [Type] Bug When a feature is broken and / or not performing as intended Needs triage Ticket needs to be triaged labels Jan 24, 2025
@github-actions github-actions bot added [Status] Escalated to Product Ambassadors [Pri] High Address as soon as possible after BLOCKER issues [Feature Group] Content Management Features related to the tools and screens that admins use to manage their sites core content. [Feature] Block Patterns Pattern content itself, and the functionality that lets you create patterns. [Feature] Plugins Features related to plugins on WordPress.com, including search, management, and installation. labels Jan 24, 2025
Copy link

OpenAI suggested the following labels for this issue:

  • [Feature Group] Content Management: The issue relates to the management and functionality of block patterns within the content management system.
  • [Feature] Block Patterns: The core of the issue is that the blockTypes property for block patterns is not being properly recognized for WPCOM sites.
  • [Feature] Plugins: This issue likely impacts functionality related to third-party plugins that may utilize block patterns.

@triple0t
Copy link
Author

@Automattic/lego -- Many thanks.

@jartes jartes added Triaged To be used when issues have been triaged. and removed Needs triage Ticket needs to be triaged labels Jan 27, 2025
@jartes jartes moved this from Needs Triage to Triaged in Automattic Prioritization: The One Board ™ Jan 27, 2025
@jartes
Copy link
Contributor

jartes commented Jan 27, 2025

📌 ACTIONS

  • Triaged

📌 Message to Author
@triple0t Thanks for reporting this! If this issue is already being worked on, remember to set it as triaged by removing the Needs Triage label, and adding the Triaged label. Also, set it as Triaged on the One Board project, and add the team :) Thank you!

@triple0t triple0t moved this from Triaged to In Progress in Automattic Prioritization: The One Board ™ Jan 27, 2025
@triple0t
Copy link
Author

@triple0t Thanks for reporting this! If this issue is already being worked on, remember to set it as triaged by removing the Needs Triage label, and adding the Triaged label. Also, set it as Triaged on the One Board project, and add the team :) Thank you!

Thank you for adding the label, @jartes

The bug was fixed in Automattic/jetpack#41324

We can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Experiment] AI labels added [Feature] Block Patterns Pattern content itself, and the functionality that lets you create patterns. [Feature Group] Content Management Features related to the tools and screens that admins use to manage their sites core content. [Feature] Plugins Features related to plugins on WordPress.com, including search, management, and installation. Lego Maintenance [Pri] High Address as soon as possible after BLOCKER issues [Status] Auto-allocated [Status] Escalated to Product Ambassadors Triaged To be used when issues have been triaged. [Type] Bug When a feature is broken and / or not performing as intended
Projects
Development

No branches or pull requests

4 participants