Skip to content

Fatal errors due to infinite recursion with Full Site Editing #26923

@bobbingwide

Description

@bobbingwide

Describe the bug
When using Full Site Editing it is fairly easy to create scenarios which lead to the website failing due to infinite recursion.
Some work has been done to prevent the problems occurring visually in the editor, but once saved it becomes very difficult to recover from the problem.

In the simplest scenario below the recursion involves a single post using the core/post-content block. More complex scenarios involve multiple posts each with their own core/query and core/post-content blocks.

WordPress core needs to appreciate that this infinite recursion can occur, take steps to prevent it and produce relevant information to the content creator and/or front end user to explain the actions taken.

I'm raising this as a separate issue to #26593, although I believe the root cause of both problems is the same.
That is, the inability to detect and prevent infinite recursion while processing potentially recursive constructs.

These recursive constructs include:

  • Post Content ( core/post-content )
  • Reusable blocks ( core/block )
  • Template parts ( core/template-parts )

plus, to be confirmed

  • possibly Post Excerpt ( core/post-excerpt )
  • Combinations of the above, if that's possible.

To reproduce
Steps to reproduce the behavior:

  1. Activate a Full Site Editing theme such as Twenty Twenty-One Blocks
  2. Activate Gutenberg as the only plugin.
  3. Create a new post.
  4. Insert a Post Content block
  5. Save
  6. View
  7. See the Fatal error

Notes:

Expected behavior
The infinite recursion should be detected, halted gracefully and an appropriate message reported to the user.
In WP_DEBUG mode contextual information should be displayed to assist with problem resolution.

Screenshots
In this screenshot the Fatal error occurs when the Allowed memory is exceeded.
image

Editor version (please complete the following information):

  • WordPress version: [e.g: 5.3.2] 5.6-beta3
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? [e.g: "gutenberg plugin", "default"] Gutenberg 9.3.0 and/or Gutenberg built from source

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows
  • Browser [e.g. chrome, safari] Chrome
  • Version [e.g. 22] Latest

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Site EditorRelated to the overarching Site Editor (formerly "full site editing")[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions