Skip to content

[Magento 2.4.8-p3] Backend Catalog > Categories not loading #40456

@vincentwennink

Description

@vincentwennink

Preconditions and environment

  • 150K+ Products
  • 800+ Categories

Steps to reproduce

  1. Update from Magento version 2.4.7-p8 to 2.4.8-p3
  2. 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

Issue: needs updateAdditional information is require, waiting for responseReported on 2.4.8-p3Indicates original Magento version for the Issue report.

Type

No type

Projects

Status

Needs Update

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions