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

Short circuit post-content rendering for revisions (#26593) #26807

Closed
wants to merge 1 commit into from

Conversation

bobbingwide
Copy link
Contributor

Description

When using Appearance > Templates to edit a template I was experiencing out of memory errors.
I tracked this down to infinite recursion while attempting to render revisions in the REST API processing for templates.
I found that the easiest fix was to short circuit the rendering for revisions.
This seemed to have no side effect on the editor; compare revisions still worked.

How has this been tested?

  • I reproduced the problem in a new WordPress Multi Site site with Twenty Twenty-One Blocks.
  • I applied the fix and rebuilt using npm run dev
  • I retried the step to edit the template.
  • It succeeded.
  • I viewed Revisions to see my changes.

Screenshots

image

image

Types of changes

Fixes #26593

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

I could not PHPUnit test the solution as I don't have a wp-env environment.

@gziolo gziolo added the [Block] Post Content Affects the Post Content Block label Nov 9, 2020
Base automatically changed from master to trunk March 1, 2021 15:44
@skorasaurus
Copy link
Member

@bobbingwide ;
#26593 has been fixed (which this issue addresses) so I'm closing this;

Please reopen if you think the PR is fulfilling something still not yet resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Content Affects the Post Content Block
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite recursion trying to edit a wp_template with revisions containing wp:post-content blocks
3 participants