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

Categories, Tags, Post Terms blocks do not reflect changes made in the editor #65239

Open
2 tasks done
johnwatkins0 opened this issue Sep 11, 2024 · 2 comments
Open
2 tasks done
Labels
[Block] Post Terms Affects the Post Terms Block [Type] Bug An existing feature does not function as intended

Comments

@johnwatkins0
Copy link
Member

johnwatkins0 commented Sep 11, 2024

Description

The Categories, Tags, and Post Terms blocks should reflect any changes made in the current editing session. E.g., if I remove Tag1 and add Tag2 to the current post, the Tags blocks should update to show Tag2 and not Tag1. Instead, I have to save and fully refresh the page to see the change.

Testing previous core versions, it seems these blocks did update in real time up to version 6.0, but stopped in version 6.1.

Step-by-step reproduction instructions

  1. Create a fresh WP install with a default theme. Optionally install the Gutenberg plugin, but this doesn't change anything.
  2. Create a new post or edit "Hello World."
  3. Add a Categories or Tags block.
  4. Change the Categories/Tags assigned to the current post.
  5. Notice that the block does not update to reflect your changes in step 4.
  6. Save the post.
  7. Completely refresh the page.
  8. Now you will see the changes reflected in the blocks.

Screenshots, screen recording, code snippet

No response

Environment info

  • WP 6.6.2.
  • With and without Gutenberg plugin v19.1.0.

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
@johnwatkins0 johnwatkins0 added the [Type] Bug An existing feature does not function as intended label Sep 11, 2024
@Mamaduka Mamaduka added the [Block] Post Terms Affects the Post Terms Block label Sep 12, 2024
@ntsekouras
Copy link
Contributor

This is the case since #43503 and it was mostly to avoid cases where a post would have too many terms that would affect the length of the query sent to the server.

I'm wondering though if we should optimize for that case. Personally I think it's more common to have less terms in the block and maybe we should consider reverting? What do you think @Mamaduka ?

@Mamaduka
Copy link
Member

We had reports of include query arguments failing. See #41847.

The query method update in #43503 is the correct way to query terms assigned to a post. To be honest, I would like to switch sidebar components to use it, but terms are only assigned to a post in DB after saving.

One can also argue that the Post Terms block is a design/theme block and should be rarely used in posts and pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Terms Affects the Post Terms Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants