-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Category product count does not include products assigned to the category itself #40295
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
base: 2.4-develop
Are you sure you want to change the base?
Category product count does not include products assigned to the category itself #40295
Conversation
|
Hi @mimou78. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
|
The security team has been informed about this pull request due to the presence of risky security keywords. For security vulnerability reports, please visit Adobe's vulnerability disclosure program on HackerOne or email psirt@adobe.com. |
1 similar comment
|
The security team has been informed about this pull request due to the presence of risky security keywords. For security vulnerability reports, please visit Adobe's vulnerability disclosure program on HackerOne or email psirt@adobe.com. |
|
@magento run all tests |
…lf-reference-40263
…lf-reference-40263
…lf-reference-40263
Summary
This pull request fixes an issue where the product count displayed in the Admin Category Grid
incorrectly shows 0 products for categories that do not have any descendants.
The current logic only counts products assigned to descendant categories and does not
include products directly assigned to the category itself.
Problem
When building the temporary table of category → descendant relationships, the SQL
logic only inserts rows for descendants, not for the category itself.
As a result:
Related Issue
Fixes #40263
What This Fix Does
This change ensures that each category always includes a self-reference entry in
the temporary category/descendant table.
As a result:
Technical Changes
(category_id = X, descendant_id = X)for everyprocessed category ID.
and the category itself.
Testing Instructions
Backward Compatibility
Risks
Low. This affects only the temporary table generation used for counting, not
the category model or product relations.