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 block fails attempting to preview recursive template parts #27612

Closed
bobbingwide opened this issue Dec 9, 2020 · 0 comments · Fixed by #28456
Closed

Template part block fails attempting to preview recursive template parts #27612

bobbingwide opened this issue Dec 9, 2020 · 0 comments · Fixed by #28456
Labels
[Block] Template Part Affects the Template Parts Block

Comments

@bobbingwide
Copy link
Contributor

bobbingwide commented Dec 9, 2020

Describe the bug
For issue #26923 I created a couple of template parts which would cause an infinitely recursive loop.
In Gutenberg 9.5.1 these cause the Template part block to fail with This block has encountered an error and cannot be previewed.

A clear and concise description of what the bug is.

To reproduce
Steps to reproduce the behavior:

  1. Using a Full Site Editing theme such as Twenty Twenty-One blocks create recursive template parts as below.
  2. Add a new post.
  3. Add a Template part block.
  4. Click on Choose existing.
  5. Wait for a while.
  6. The block will fail.

issue-27.html

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

issue-30.html

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

Expected behavior

  • The fixes developed to prevent recursion in the server need equivalent logic in the block editor.
  • The preview should indicate that recursion has occurred, indicating where it was detected.
  • It could suggest a method for fixing the problem.

Screenshots
recursive-template-part-block

Editor version (please complete the following information):

  • WordPress version: [e.g: 5.3.2] 5.6
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? [e.g: "gutenberg plugin", "default"] 9.5.1
  • If the Gutenberg plugin is installed, which version is it? [e.g., 7.6]

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows
  • Browser [e.g. chrome, safari] Chrome
  • Version [e.g. 22] 87.0.4280.88 (Official Build) (64-bit)

Additional context
See also

@ntsekouras ntsekouras added the [Block] Template Part Affects the Template Parts Block label Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Template Part Affects the Template Parts Block
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants