Skip to content

Categories Product Amount shown as 0 in admin #40263

@VladyslavSikailo

Description

@VladyslavSikailo

Preconditions and environment

  • Magento or Adobe Commerce 2.4.8-p3

Included quality patch content: ACSD-67643_2.4.8-p1.patch

Steps to reproduce

  • Create 401 categories or set the value of \Magento\Catalog\Model\ResourceModel\Category\Collection::BULK_PROCESSING_LIMIT to 1
    • Changing BULK_PROCESSING_LIMIT is needed to emulate a big catalog, so Magento runs a special mechanism (using a temporary table) to retrieve product count per category. This specific mechanism has a bug.
  • After creating products and categories, ensure all categories are anchors by running: UPDATE catalog_category_entity_int SET value = 1 WHERE attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'is_anchor');
  • Open categories page in admin
  • Open any category without children
  • Assign any product to this category
  • Reload page

Expected result

  • This category must have (1) as product count in a left bar with categories list

Actual result

  • The category has (0) as product count in a left bar with categories list

Additional information

  • This happens because of the quality patch ACSD-65848 installed
  • It contains commit dba0f6f which removes OR ce2.entity_id = ce.entity_id from SQL Select Query
  • So categories without child categories won't be included in SQL Select

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

No one assigned

    Labels

    Area: CatalogComponent: AdminIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Reported on 2.4.8-p3Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    Status

    Ready for Development

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions