Skip to content

Loading category from database twice on a category Page #40472

@alinalexandru

Description

@alinalexandru

Preconditions and environment

Magento: 2.4.8-p1

Steps to reproduce

Navigate to a category page.
In \Magento\Catalog\Controller\Category\View::_initCategory the category is loaded from Category Repository.
Category repository has build in a cache layer.

Further in the code, \Magento\CatalogSearch\Model\Layer\Filter\Category::apply is called, which calls the \Magento\Catalog\Model\Layer\Filter\DataProvider\Category::getCategory method.

But \Magento\Catalog\Model\Layer\Filter\DataProvider\Category::getCategory is not using the Category Repository and that means that the data is no loaded using the information already cached.

Was there a reason why Category Repository was not used there?

Expected result

The category shouldn't be loaded multiple times from database.

Actual result

The category is loaded multiple times from database

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

Area: CatalogComponent: CatalogIssue: 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-p1Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

Status

Ready for Development

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions