-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Infinite recursion trying to edit a wp_template with revisions containing wp:post-content blocks #26593
Comments
Here's a screenshot of the problem being reproduced using the Twenty Twenty-One Blocks theme Steps.
Content after Step 2.
After editing. Step 4.
|
Hi @bobbingwide! I followed your reproduction steps but wasn't able to see any infinite recursion. Are you still seeing this? If so, maybe could you post a screen recording of you triggering the error? |
It was fixed with #28456. I didn't reference this issue properly. I will close this one, but I'm happy to work on a follow-up if something related pops up. It's a complex issue 😄 |
Hi @noisysocks. The problem has now changed. It doesn't go recursive in the server but it does in the editor. |
Let's reopen as we don't have the Post Content block covered. I almost forgot about it. Thanks for bringing it up again @bobbingwide. |
Yes, those impressive fractals are all coming from how the Post Content blocks work. Once it is fixed internally, it should disappar. |
Any comment on my aside regarding the breadcrumbs? I haven't ever manually created that level of nesting nor used very long block names in a language other than English. |
No clue, it's a separate issue though. |
Describe the bug
I'm learning how to develop a Full Site Editing theme.
Sometimes I use the Site Editor (beta) and other times Appearance > Templates or Appearance > Template Parts.
Having created a template-part called
post-content
I encountered problems when I attempting to edit some of the Templates ( wp_template ). The editor never loaded. It either timed out or produced a Fatal error - memory exhausted.I tracked the problem down to a never ending recursion involving
the_content
andpre_render_block
, while runningWP_Rest_Revisions_Controller->prepare_item_for_response()
.The problem occurs when the
wp:post-content
block is being processed.Between them the block rendering in
gutenberg_render_block_with_assigned_block_context()
andthe_content
filtering ingutenberg_render_block_core_post_content()
produces a never ending recursive loop which isn't shortcircuited by the current test on the$block->context['postId']
ingutenberg_render_block_core_post_content()
.Example:
This is the content of the
revision
postId = 715 which is an autosaved revision of thesingle
wp_template 694.To reproduce
Steps to reproduce the behavior:
wp:post-content
( e.g.single
).(*) I believe the problem may occur with both autosaved revisions and user saved revisions.
Expected behavior
The Editor should display the 'single' Template, with the template parts rendered.
The post content block should say "This is a placeholder for post content."
Screenshots
Here I get the Fatal error due to the logic in my tracing plugin. It happens a lot earlier than the time out.
Editor version (please complete the following information):
Desktop (please complete the following information):
Additional context
gutenberg_render_block_core_post_content()
The text was updated successfully, but these errors were encountered: