Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

Query Loop does not display on site if Inherit query from template is enabled #69221

Open masperber opened 2 years ago

masperber commented 2 years ago

Quick summary

When using a Query Loop Block, the Query Loop is hidden from the live site if the Inherit query from template option is selected from the Block settings.

Steps to reproduce

  1. On a site with any theme, add a Query Loop to a blank page.
  2. Choose any of the default templates
  3. Leave the Inherit query from template option enabled
  4. View the live page or preview

What you expected to happen

The Query Loop should display posts as it does in the editor.

What actually happened

The Query Loop does not appear on the live site or preview at all.

Context

Customer report 37468979-hc

Confirmed on my test sites, both Atomic and simple, using Classic, Hybrid, and FSE themes.

Platform (Simple, Atomic, or both?)

Simple, Atomic

Theme-specific issue?

No response

Browser, operating system and other notes

No response

Reproducibility

Consistent

Severity

All

Available workarounds?

Yes, difficult to implement

Workaround details

The Query Loop displays if the Inherit query from template option is disabled. However, this option is enabled by default, which could lead to considerable user confusion.

cuemarie commented 2 years ago

πŸ“Œ SCRUBBING : RESULT

πŸ“Œ FINDINGS/SCREENSHOTS/VIDEO

AT Example Markup on 2022-10-25 at 17:54:38

Markup on 2022-10-25 at 17:54:58

Simple Example Markup on 2022-10-25 at 17:55:37

Markup on 2022-10-25 at 17:55:54

πŸ“Œ ACTIONS

πŸ“Œ Message to Author/Quality Squad

In a single page there is no much use in having an inherit Query, but instead a custom one.

In general we need to find a way to detect the context a Query lives (page/archive) and set the inherit option accordingly, but this is not yet implemented.

arthur791004 commented 2 years ago

I've also encountered this issue since Gutenberg v13.7 above. The root cause might probably be use_global_query from https://github.com/WordPress/gutenberg/pull/32514. But I'm not sure why it makes the posts become empty if inherit query is enabled

vinnykaur commented 1 year ago

Another one at zen-5774388

github-actions[bot] commented 1 year ago

Support References

This comment is automatically generated. Please do not edit it.

rinazrina commented 1 year ago

Another report: #5820182-zen

jartes commented 1 year ago

Another one on 42594789-hc

jamiepalatnik commented 1 year ago

Another report: 6550825-zd-woothemes

masperber commented 1 year ago

@cuemarie Do you think we might be able to get an assignee for this? I think it's pretty unfortunate that Query Loops just don't work at all when used by a page unless you disable Inherit query from template, which is on by default. Turning this option off by default, or even better removing it entirely when the block is placed on a page, would be really helpful.

cuemarie commented 1 year ago

Hey @masperber ! Looks like the underlying issue here is in Gutenberg Core, so I'm not sure if this is something that can be addressed just within WordPress.com.

Looping in @liviopv though, who might be able to help give this request (as well as the Core counterpart, here: https://github.com/WordPress/gutenberg/issues/30369 ) more support in conversations between .com and .org. Your thoughts or help escalating this would be much appreciated! Thanks for taking a look!

πŸ“Œ ACTIONS

Gustavo-Hilario commented 1 year ago

Another report: 6776963-zen

annezazu commented 2 months ago

Noting that this is related to adding a query loop to a page rather than a template with a fix in progress here: https://github.com/WordPress/gutenberg/pull/65067