Open
Description
Preconditions and environment
- Magento version 2.4.6-p4
Steps to reproduce
$this->searchCriteriaBuilder->addFilter('entity_id', [1,2], 'in');
$searchCriteria = $this->searchCriteriaBuilder->create();
$this->productRepository->getList($searchCriteria);
$this->productRepository->getById(1);
Expected result
getById
method should use cache generated by getList
Actual result
Product with ID 1
is loaded twice. This is because the cache key is generated with storeId = null
for getById
, but with storeId = 1
(default store) for getList
.
(Same thing with get
instead of getById
)
Additional information
get :
magento2/app/code/Magento/Catalog/Model/ProductRepository.php
Lines 278 to 280 in 488c103
getById :
magento2/app/code/Magento/Catalog/Model/ProductRepository.php
Lines 308 to 310 in 488c103
getList :
magento2/app/code/Magento/Catalog/Model/ProductRepository.php
Lines 717 to 727 in 488c103
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
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmedA defect with this priority could have functionality issues which are not to expectations.Indicates original Magento version for the Issue report.The issue has been reproduced on latest 2.4-develop branchIssue related to Developer Experience and needs help with Triage to Confirm or Reject it