-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Preconditions and environment
- 150K+ Products
- 800+ Categories
Steps to reproduce
- Update from Magento version 2.4.7-p8 to 2.4.8-p3
- Go to backend Catalog > Categories
Expected result
Categories are loading.
Actual result
Categories not loading (spinner). The query takes too long.
Function loadProductCount() in vendor/magento/module-catalog/Model/ResourceModel/Category/Collection.php is causing this. If if ($countAnchor) { is replaced with the condition as shown below (as it was in 2.4.7-p8), the categories load without any issues.
if ($countAnchor) { // Retrieve Anchor categories product counts $categoryIds = array_keys($anchor); $countSelect = $this->getProductsCountQuery($categoryIds, (bool)$websiteId); $categoryProductsCount = $this->_conn->fetchPairs($countSelect); foreach ($anchor as $item) { $productsCount = isset($categoryProductsCount[$item->getId()]) ? (int)$categoryProductsCount[$item->getId()] : $this->getProductsCountFromCategoryTable($item, $websiteId); $item->setProductCount($productsCount); } }
Additional information
No response
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status