Skip to content

[Bug]: Query Loop block causes infinite loop with older themes and inherit template #66270

@sirbrillig

Description

@sirbrillig

Quick summary

On a site with a pre-site-editor theme like Baskerville, Twenty Twenty, or even Twenty Twenty-One, using the Query Loop block causes a page to enter an infinite loop and eventually time out. This only happens if "Inherit query from template" is set.

This appears to be a wpcom-only bug. I've tried the same steps on a brand-new WP 6.0 site and the issue does not occur.

The issue does not occur in very new themes like Twenty Twenty-Two.

Steps to reproduce

  1. Create a new site on WordPress.com or use an existing site.
  2. Set the site's theme to Twenty Twenty-One or Baskerville.
  3. Create a new post.
  4. Inside the post content add a Query Loop block. Choose any layout for it.
  5. In the block settings, turn on "Inherit query from template".
  6. Publish the post.
  7. View the post.

Screen Shot 2022-08-04 at 12 58 37 PM

What you expected to happen

To see the post.

What actually happened

A blank page is shown after a long loading time. In the server logs, we see a Fatal error: Allowed memory size of 536870912 bytes exhausted, but the stack trace varies considerably across all sorts of files.

Sometimes instead of a blank page, we get the same post repeated over and over again.

Browser

Google Chrome/Chromium

Context

Automatticians discovered this from Payments logs.

Platform (Simple, Atomic, or both?)

Simple, Atomic

Other notes

No response

Reproducibility

Consistent

Severity

Some (< 50%)

Available workarounds?

Yes, easy to implement

Workaround details

Change the Query Loop block to turn off "Inherit query from template".

Metadata

Metadata

Assignees

No one assigned

    Labels

    TriagedTo be used when issues have been triaged.[Platform] Atomic[Platform] Simple[Pri] HighAddress as soon as possible after BLOCKER issues[Status] Core Fix NeededA fix within the Core WordPress or Gutenberg project is required to resolve this issue.[Type] BugWhen a feature is broken and / or not performing as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions