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

Duplicating Query Block can result in duplicate Query IDs #55823

Open
peterwilsoncc opened this issue Nov 2, 2023 · 6 comments
Open

Duplicating Query Block can result in duplicate Query IDs #55823

peterwilsoncc opened this issue Nov 2, 2023 · 6 comments
Labels
[Block] Query Loop Affects the Query Loop Block [Type] Bug An existing feature does not function as intended

Comments

@peterwilsoncc
Copy link
Contributor

Description

Duplicating the Query Block can result in duplicate query IDs resulting in unexpected enhanced pagination behaviour.

Step-by-step reproduction instructions

  1. Install WP Trunk ( WordPress/wordpress-develop@64bfb23 )
  2. Do not enabled Gutenberg
  3. Generate some posts via wp cli, wp post generate
  4. Go to the site editor
  5. Edit the home page
  6. Remove all group blocks except for the group containing Query block (this is to make it easier to see the effect while testing)
  7. Select the query block
  8. Ensure "Force page reload" is turned off
  9. Add a pagination block if required
  10. Select the group block above the query block (ie, the group containing the heading "Watch, Read, Listen")
  11. Duplicate the group
  12. In the duplicated group, modify the query so it doesn't inherit from the main query
  13. Save the template
  14. Visit the front end of the site
  15. Click next page on either query block
  16. Observe the page changes on both blocks

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

@peterwilsoncc peterwilsoncc added the [Type] Bug An existing feature does not function as intended label Nov 2, 2023
@Mamaduka
Copy link
Member

Mamaduka commented Nov 3, 2023

This is a known issue with internal attributes - #29693. Here're two ongoing explorations: #34750 and #38643.

@jordesign jordesign added the [Block] Query Loop Affects the Query Loop Block label Nov 3, 2023
@gziolo
Copy link
Member

gziolo commented Nov 6, 2023

This is a known issue with internal attributes - #29693. Here're two ongoing explorations: #34750 and #38643.

There is a detailed overview of the current limitations of block attributes provided by @noisysocks in #49466. There are multiple ways we could address it, but all the options should have working prototypes so we would need to finally make a decision what is the best way path forward and incorporate them with the Query block to fix the issue.

@ryanwelcher
Copy link
Contributor

Wanted to bump this as I just received a report on my Advanced Query Loop plugin for this - ryanwelcher/advanced-query-loop#42

@archiveofwork
Copy link

I was about to post about this same issue

@skorasaurus
Copy link
Member

This still occurs however I've worked around this by manually changing the queryid of one of the loops in the code editor.

@albanyacademy
Copy link

Wanted to bump this as I just received a report on my Advanced Query Loop plugin for this - ryanwelcher/advanced-query-loop#42

for our plugin we just expose the query id:
image

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
Development

No branches or pull requests

8 participants