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 Loop: When a variation is picked via BlockVariationPicker component, the post type is always "Post" instead of the one defined via the variation #46367

Closed
gigitux opened this issue Dec 7, 2022 · 0 comments · Fixed by #46410
Assignees
Labels
[Block] Query Loop Affects the Query Loop Block [Type] Bug An existing feature does not function as intended

Comments

@gigitux
Copy link
Contributor

gigitux commented Dec 7, 2022

Description

When a Query Loop variation is picked via the BlockVariationPicker component, the post type is "Post" instead of the one defined via the variation.
This happens because the check at line 144 is wrong. We have to reverse it.

I noticed this issue working on the Product Query woocommerce/woocommerce-blocks#7852.

Step-by-step reproduction instructions

  1. Create a Query Loop variation that has as post type "Page" (you can use this code).
  2. Add the Query Loop block.
  3. Click Start Blank.
  4. Select the variation created previously. If you copy-pasted the code above, the name of the variation is "Query Loop variation".
  5. In the right sidebar, you can see that the selected post type is "Post", instead of "Page".

Screenshots, screen recording, code snippet

Screen.Capture.on.2022-12-07.at.16-28-41.mov

Environment info

  • WordPress 6.1
  • Gunteberg trunk version

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

@gigitux gigitux changed the title Query Loop: When a variation is picked via __experimentalBlockVariationPicker component, the post type is the default one Query Loop: When a variation is picked via __experimentalBlockVariationPicker component, the post type is always "Post" instead of the one defined via the variation Dec 7, 2022
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Dec 7, 2022
@gigitux gigitux changed the title Query Loop: When a variation is picked via __experimentalBlockVariationPicker component, the post type is always "Post" instead of the one defined via the variation Query Loop: When a variation is picked via BlockVariationPicker component, the post type is always "Post" instead of the one defined via the variation Dec 7, 2022
@kathrynwp kathrynwp added [Type] Bug An existing feature does not function as intended [Block] Query Loop Affects the Query Loop Block labels Dec 7, 2022
@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label Jan 11, 2023
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 [Type] Bug An existing feature does not function as intended
Projects
None yet
3 participants