[Issue] Take required product attributes into account when caching used products #32765
Closed
4 tasks
Labels
Component: ConfigurableProduct
Priority: P3
May be fixed according to the position in the backlog.
Progress: done
Reported on 2.4.x
Indicates original Magento version for the Issue report.
Severity: S2
Major restrictions or short-term circumventions are required until a fix is available.
This issue is automatically created based on existing pull request: #32698: Take required product attributes into account when caching used products
Description (*)
When calling
Magento\ConfigurableProduct\Model\Product\Type\Configurable::getUsedProducts()
with custom required attributes after that method has already been called before, the collection doesn't load your custom defined attributes.The caching plugin around this method,
Magento\ConfigurableProduct\Model\Plugin\Frontend\UsedProductsCache::aroundGetUsedProducts()
actually does take the passed required attributes into account, by generating a cache key, but once proceeded to the original method, this is lost again, when$product->getData($this->_usedProducts)
already contains a product collection.Manual testing scenarios (*)
This can be confirmed by running the added integration test without the changes I proposed, you'll see it will fail, because the
meta_description
attribute of the product will benull
at all times.Contribution checklist (*)
The text was updated successfully, but these errors were encountered: