Query loop infinite loop when inheriting query from template #43198
Labels
[Block] Query Loop
Affects the Query Loop Block
[Priority] High
Used to indicate top priority items that need quick attention
[Type] Bug
An existing feature does not function as intended
Description
This originally presented as a bug on WordPress.com where pages would not load at all in some occasions and was reported here:
Automattic/wp-calypso#66270
High-level, the issue is that in #40656 we changed how we handled the inherit query from template logic. Instead of pulling args out of the template query and then creating a new query object. We actually began to use the template query.
When we then call
have_posts
and hit the end of the loop within the block rendering, this resets the query while we're still in the block, and we're never able to pass thehave_posts
check in the template.Step-by-step reproduction instructions
See Automattic/wp-calypso#66270 (comment)
Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: