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

core/post-content patterns fail to render preview on page creation of patterns referenced within them #45586

Closed
aplauche opened this issue Nov 7, 2022 · 2 comments
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced Needs Testing Needs further testing to be confirmed.

Comments

@aplauche
Copy link

aplauche commented Nov 7, 2022

Description

I noticed I can create page template patterns (that autoload on page creation) fine by building out content in the editor and then copying the code, but I'd like to create these core/post-content patterns with just a few references to my other section style patterns (otherwise there is a lot of repeating the same pattern multiple places making it hard to maintain). When I try to do this manually it breaks the preview when creating a new page. You can see that the "page text basic" renders partly the block markup, but not the included patterns.

For reference, the patterns still work perfectly when you click to insert them, it is just the preview that does not work. I can also insert them, the switch to code, copy everything and use that as a core/post-content pattern and the preview works again. It is just the pattern reference within preview that is breaking.

Full disclosure: this is happening in a custom theme, so could be a syntax issue, but the behavior of the pattern working but not the preview seemed like a possible bug to me, so wanted to flag.

Step-by-step reproduction instructions

  1. add a standard pattern to your block theme like "hero section"
  2. create a pattern with Block Types: core/post-content
  3. Add the standard pattern to this template like so <!-- wp:pattern {"slug":"example/hero"} /-->
  4. Create a new page and the preview does not seem to render the pattern

Screenshots, screen recording, code snippet

image

image (1)

image (5)

Environment info

  • WordPress 6.1
  • Custom Theme This could an issue with the way my custom theme is setup, but the patterns still work perfectly so the behavior seems like a potential bug and wanted to flag

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

Yes

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

Yes

@paaljoachim paaljoachim added Needs Testing Needs further testing to be confirmed. [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels Nov 7, 2022
@ndiego
Copy link
Member

ndiego commented Nov 8, 2022

Hi @aplauche, this is a known issue and has been fixed in the latest version of Gutenberg. See the related PR here: #44784.

Can you try testing again using Gutenberg 14.4? I have tested on my end using the Twenty Twenty-Three theme, and the nested patterns are displaying as expected. Thanks!

@aplauche
Copy link
Author

aplauche commented Nov 8, 2022

@ndiego Thanks for the info! Just tested and can confirm all is working perfectly with Gutenberg 14.4. Closing now!

@aplauche aplauche closed this as completed Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced Needs Testing Needs further testing to be confirmed.
Projects
None yet
Development

No branches or pull requests

3 participants