-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Open
Labels
Area: CatalogIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is 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.A defect with this priority could have functionality issues which are not to expectations.Progress: dev in progressReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 releaseReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branchSeverity: S2Major restrictions or short-term circumventions are required until a fix is available.Major restrictions or short-term circumventions are required until a fix is available.
Description
Preconditions
- Magento 2.1.7
- PHP 7.0.22
Steps to reproduce
- Create a bundle product with at least 1 option of simple product
- Create a module which defines any extension attributes for
Magento\Catalog\Api\Data\ProductInterface
- Create an observer for
catalog_product_collection_load_after
event and in that observer set extension attribute defined in step 2 on each item - Try to retrieve bundle product using
Magento\Catalog\Api\ProductRepositoryInterface::getById()
method providing only id of the bundle product created in step 1.
Expected result
- Receive an instance of
Magento\Catalog\Api\Data\ProductInterface
with data of bundle product
Actual result
- An error is thrown:
Argument 1 passed to Magento\Bundle\Model\Link::setExtensionAttributes() must be an instance of Magento\Bundle\Api\Data\LinkExtensionInterface, instance of Magento\Catalog\Api\Data\ProductExtension given, called in vendor/magento/framework/Api/DataObjectHelper.php on line 125
After inspection I found that bundle module defines its own extension attribute bundle_product_options
for Magento\Catalog\Api\Data\ProductInterface
. When it tries to set it for loaded product it fetches collection of products defined as children in the bundle and converts those products to array of Magento\Bundle\Api\Data\OptionInterface
classes. The problem is those products have extension_attributes
set in $_data
and the class there is Magento\Catalog\Api\Data\ProductExtension
as it should be for product class.
Swahjak, wouter-toppy, akimo, fheyer, alfredsgenkins and 4 more
Metadata
Metadata
Assignees
Labels
Area: CatalogIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is 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.A defect with this priority could have functionality issues which are not to expectations.Progress: dev in progressReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 releaseReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branchSeverity: S2Major restrictions or short-term circumventions are required until a fix is available.Major restrictions or short-term circumventions are required until a fix is available.