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

Query block: Editor preview is different from the frontend #29438

Open
david-szabo97 opened this issue Mar 1, 2021 · 8 comments
Open

Query block: Editor preview is different from the frontend #29438

david-szabo97 opened this issue Mar 1, 2021 · 8 comments
Labels
[Block] Query Loop Affects the Query Loop Block [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Bug An existing feature does not function as intended

Comments

@david-szabo97
Copy link
Member

Query block doesn't take the template into account. This results in a difference between the editor and actual content on the frontend.

Enabling "Inherit query from URL" should take into account what template is being edited. In this case, I'm editing the Page template so the query loop should only consist of a single page object.

Screenshots

Editor:

image

Frontend:

image

@david-szabo97 david-szabo97 added [Type] Bug An existing feature does not function as intended [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Mar 1, 2021
@ntsekouras ntsekouras added the [Block] Query Loop Affects the Query Loop Block label Mar 18, 2021
@ntsekouras
Copy link
Contributor

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.

@Thelmachido
Copy link

I can still reproduce this WordPress 6.0.1 + Gutenberg 13.8.1, adding the query loop to a page template with the option to "Inherit query from URL" enabled still returns different results.

Backend:
Untitled 3

Frontend:

Untitled 3

I not quite sure if there is use in having an inherit query on a single page.

@masperber
Copy link

This issue is still present in WordPress 6.1.1 and Gutenberg v14.7.3.

It would be great if this option were not offered if there is no template to inherit the query from, or at the very least if the inherit query option were disabled by default.

@imanish003
Copy link
Contributor

This problem exists even when Inherit query from template is disabled.

In Query Loop block, Taxonomies filter is not working in Editor. Here is a quick demo video:

Screen.Recording.2023-02-02.at.3.37.51.PM.mov

As you can see in the video, When I add a product category, the products don't update in Editor. Although, correct products show up when I view them on frontend after saving.

This issue was reported in Woocommerce products block, which is a variation of Query loop block:
woocommerce/woocommerce-blocks#7867

Step-by-step reproduction instructions

  1. Add Query loop block to Editor
  2. Inside Inspector controls, Toggle Inherit query from template to the off state.
  3. Choose post type "Product"
    image
  4. Now, Select Taxonomies in Filters
    image
  5. Add a category in Product categories.
    image
  6. As soon as category is selected, only products with the added category should show in Editor but all products are showing.

What's expected?

Only selected category products should show in Editor.

@Marc-pi
Copy link

Marc-pi commented Feb 2, 2023

@ndiego / @annezazu could you add this very old major bug into 6.2 release process ? thx

@Marc-pi
Copy link

Marc-pi commented Mar 14, 2023

the WC Products Block issue is fixed with WC Blocks 9.8.0 see woocommerce/woocommerce-blocks#8611

@ndiego
Copy link
Member

ndiego commented Mar 14, 2023

Awesome, thanks for the update @Marc-pi.

@Marc-pi
Copy link

Marc-pi commented Mar 14, 2023

i'll find some time to test to above issue with GB purely (original post)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

7 participants