-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Component: ConfigurableProductComponent: Framework/CodeFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release
Description
Preconditions (*)
- Magento Version 2.3.2
Steps to reproduce (*)
- Try to load custom attribute's value from \Magento\ConfigurableProduct\Model\Product\Type\Configurable::getUsedProducts()
Parameters are $product, $requiredAttributeIds
Expected result (*)
- The attributes in $requiredAttributeIds get loaded and their values are accessible after loading
Actual result (*)
- You only have to look at the code to know the parameter does not get used for loading, it just gets used for the cache key!
/**
* Returns array of sub-products for specified configurable product
*
* $requiredAttributeIds - one dimensional array, if provided
*
* Result array contains all children for specified configurable product
*
* @param \Magento\Catalog\Model\Product $product
* @param array $requiredAttributeIds
* @return ProductInterface[]
*/
public function getUsedProducts($product, $requiredAttributeIds = null)
{
$metadata = $this->getMetadataPool()->getMetadata(ProductInterface::class);
$keyParts = [
__METHOD__,
$product->getData($metadata->getLinkField()),
$product->getStoreId(),
$this->getCustomerSession()->getCustomerGroupId()
];
if ($requiredAttributeIds !== null) {
sort($requiredAttributeIds);
$keyParts[] = implode('', $requiredAttributeIds);
}
$cacheKey = $this->getUsedProductsCacheKey($keyParts);
return $this->loadUsedProducts($product, $cacheKey);
}
sergei-sss
Metadata
Metadata
Assignees
Labels
Component: ConfigurableProductComponent: Framework/CodeFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release