-
Notifications
You must be signed in to change notification settings - Fork 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
[Bug]: Query Loop block causes infinite loop with older themes and inherit template #66270
Comments
Props to @martian77 and @kanishkdudeja for starting the investigation that led to this report and to @vnsavage and @kettultim for providing additional details. |
Some debugging going on in Slack p1659993827084209-slack-C02FMH4G8 |
This seems related to WordPress/gutenberg#40656. When I apply 2d1b8-pb/#diff to my sandbox, I'm able to get the page to render. cc @draganescu in case he has any thoughts. |
I have nothing I am afraid. Without an env to debug not sure what would be the cause of the loop. The PR mostly removes code so that makes it even harder to intuit :) Let me know if I can help otherwise. |
📌 HOUSEKEEPING
📌 SCRUBBING
📌 FINDINGS/SCREENSHOTS/VIDEO
📌 ACTIONS
|
I can reliably reproduce this issue by doing the following:
Now, the one difference between WPCOM and the self-hosted jurassic.ninja site is that the JN site actually outputs some content whereas we get a white page. But, there is an infinite loop all the same. We can demonstrate that with the following:
What's going on here? Well, as @danielbachhuber touched on in the Slack debugging thread, when we call The root here is that, in PHP, objects are effectively passed by reference and in WordPress/gutenberg#40656 we made a change to reference the original query object, whereas we were not doing that before. We can also verify this by adding the
My suggestion is that we probably revisit the solution in the Gutenberg PR as I can reproduce in a self-hosted site as well. If you'd like to see the jurassic.ninja test site that I've been using, you can see it at https://extensive-kingfisher.jurassic.ninja. Glad to dm a password as well. |
This is now fixed for Simple sites in D85886-code. I created a Gutenberg issue upsteam at WordPress/gutenberg#43198. Of note, this does not address the issue for Atomic sites. |
Howdy! Thanks for the great debugging and repro steps. There is a fix Prevent query block from looping in classic themes that should take care of the problem. |
I merged WordPress/gutenberg#43221 so Gutenberg trunk should now have this fixed. |
Closing since this should be fixed now. |
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
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".
The text was updated successfully, but these errors were encountered: