Automattic / wp-calypso

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

Categories and Product Categories blocks not functioning #87074

Closed rakshitwesley closed 1 month ago

rakshitwesley commented 7 months ago

Quick summary

Both the "Categories" and "Product Categories" blocks are not functioning correctly when added to a site; they display "No categories."

Steps to reproduce

  1. Verify that the site has post categories or product categories.
  2. On a new page, add either of these two blocks. tQAlyp.png

What you expected to happen

Expected relevant categories to be displayed

What actually happened

It displays "No categories" GRkLAR.png

Impact

Most (> 50%)

Available workarounds?

Yes, easy to implement

Platform (Simple and/or Atomic)

Simple, Atomic

Logs or notes

Tested with both classic and site editor themes, and the results were the same.

Workaround: Use categories list block.

rickmgithub commented 7 months ago

📌 REPRODUCTION RESULTS

📌 FINDINGS/SCREENSHOTS/VIDEO

I can replicate this on a site with products and categories.

https://github.com/Automattic/wp-calypso/assets/13706336/989b6036-063b-4990-a231-cc8e93b350b8

📌 ACTIONS

Triaged

alaczek commented 1 month ago

Can you provide a bit more details on how this was tested - what page or template these blocks were inserted into?

I was not able to replicate this issue. Here's what I did (on an Atomic site):

To display all categories/ product categories outside of the loop context Categories List and Product Categories List blocks should be used instead.

Please let me know if this makes sense or if I missed something.

mrfoxtalbot commented 1 month ago

What you say makes sense @alaczek, those blocks can only be used insider a query loop block. We could question why users are allowed to add them elsewhere but that's a different story.

On a new page, add either of these two blocks.

Looking at this part of the "how to replicate list", it sounds like this was a misunderstanding.

I think we can go ahead and close this one.

alaczek commented 1 month ago

Ok, thanks for following up!