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

Template Part: using name "content" conflicts with the post content block #58215

Closed
dabowman opened this issue Jan 24, 2024 · 5 comments · Fixed by #58807
Closed

Template Part: using name "content" conflicts with the post content block #58215

dabowman opened this issue Jan 24, 2024 · 5 comments · Fixed by #58807
Assignees
Labels
[Block] Post Content Affects the Post Content Block [Block] Template Part Affects the Template Parts Block [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release

Comments

@dabowman
Copy link

Description

I created a pattern called "Content". I added the post content block inside of it. This results in the pattern being inserted inside itself.

Step-by-step reproduction instructions

Make new template part in the general area.
Name it Content
add the "Content" block inside of it.
You should get a "this block cannot be rendered inside itself" error.

Screenshots, screen recording, code snippet

video1577399600.mp4

Environment info

Wp 6.4
Gutenberg 17.5.1

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

Yes

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

No

@dabowman dabowman added the [Type] Bug An existing feature does not function as intended label Jan 24, 2024
@annezazu
Copy link
Contributor

Hey David! I can't replicate this with a site using 6.4.2:

Screen.Recording.2024-01-24.at.9.59.50.AM.mov

However, I could replicate with 6.4.2 + GB 17.5.1:

Screen.Recording.2024-01-24.at.10.01.50.AM.mov

Looks like something changed since 6.4.2. Adding this to the 6.5 board as this is a regression.

@annezazu annezazu added [Type] Regression Related to a regression in the latest release [Block] Post Content Affects the Post Content Block [Block] Template Part Affects the Template Parts Block [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels Jan 24, 2024
@annezazu annezazu changed the title if you name a pattern "content" it conflicts with the post content block Template Part: using name "content" conflicts with the post content block Jan 24, 2024
@colorful-tones
Copy link
Member

I'm digging into this one to find where the regression was introduced.

Test instructions to reproduce the issue:

  1. Launch Site Editor > Patterns > Manage all template parts (at bottom) > Add New Template Part
  2. Name the template part "Content" (this is not critical and seems that the naming is not an issue in this matter), and choose 'General' as the type, and click 'Create'
  3. Add the Content block and note the message: 'Block cannot be rendered inside itself.' 👈 This message was not appearing before.

@colorful-tones
Copy link
Member

Something introduced in Gutenberg 17.1.0 is where the regression is caused. I'm trying to narrow down the commit now.

@colorful-tones
Copy link
Member

Ok, it seems that this regression was introduced in f9b544d
Pinging @youknowriad for clarity, because he worked on the associated PR #56000

@annezazu
Copy link
Contributor

annezazu commented Feb 1, 2024

Thanks so much for tracking this down!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Content Affects the Post Content Block [Block] Template Part Affects the Template Parts Block [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants