Fatal error: cyclical embedded blocks #25472
Labels
[Feature] Synced Patterns
Related to synced patterns (formerly reusable blocks)
[Status] Duplicate
Used to indicate that a current issue matches an existing one and can be closed
[Type] Bug
An existing feature does not function as intended
Describe the bug
#22080 fixed the infinite loop that occurred when the post content block tries to render the same post that it's embedded in.
This, however, isn't the only scenario where an infinite loop could occur. In theory, it could occur through:
For example, I was able to produce a fatal error with two reusable blocks that embed each other:
Example 1
Steps to reproduce the behavior:
Example 2
wp_block
towp_template_part
and updated the content of 168 accordingly:169 retains the same post content as example 1
See fatal error whenever either reusable block or template part is rendered
Expected behavior
The expected behavior that I would suggest is to keep rendering a cycle of embedded blocks until one block tries to render a piece of content that is already part of the cycle, and then render a placeholder instead to break the cycle.
Editor version (please complete the following information):
The text was updated successfully, but these errors were encountered: