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

The recursive template parts in Fizzie break Gutenberg's Template parts block #49

Closed
bobbingwide opened this issue Dec 8, 2020 · 2 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@bobbingwide
Copy link
Owner

I wanted to test my rich text localization ( l10n) logic in Gutenberg 9.5.1 so I created a template part called i18n-rich-text.html.
I tried to load it using the Template part block in a page, while in the bb_BB locale.

But in s.b/wp56 I got This block has encountered an error and cannot be previewed even before I had a chance to pick the template part.
I believe this was due to the Template part block trying to display Previews of the blocks and failing to detect recursion.

Note: In s.b/wp55/tt1 - with the recursive template parts I'd created for Twenty Twenty-One Blocks it causes Chrome to time out.
image

Clearly there's a problem with the Template parts block ( core/template-part ).
But what should I do as a workaround?

@bobbingwide
Copy link
Owner Author

Workaround

Edit one of the template parts so that it doesn't go recursive.
This can be done by removing the blank space between the block name and the attributes.
eg

<ul>
    <li>Issue-30 test case.
    <!-- wp:template-part{ "slug": "issue-27", "theme": "fizzie" } /-->
    </li>
</ul>

@bobbingwide
Copy link
Owner Author

Template parts can no longer be inserted in the block editor.
They can be inserted in the Site Editor.
I reverted issue-30.html and tested in the Site Editor.
The recursion detection logic in Gutenberg worked. It was fixed in March 2021.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant