Skip to content

Commit d6b53a4

Browse files
committed
MAGE-938 Fix type mismatch
1 parent 23637db commit d6b53a4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Helper/Entity/ProductHelper.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Algolia\AlgoliaSearch\Helper\Logger;
1818
use Algolia\AlgoliaSearch\Service\IndexNameFetcher;
1919
use Magento\Bundle\Model\Product\Type as BundleProductType;
20+
use Magento\Catalog\Api\Data\ProductInterfaceFactory;
2021
use Magento\Catalog\Model\Product;
2122
use Magento\Catalog\Model\Product\Attribute\Source\Status;
2223
use Magento\Catalog\Model\Product\Type;
@@ -108,7 +109,8 @@ public function __construct(
108109
protected GroupExcludedWebsiteRepositoryInterface $groupExcludedWebsiteRepository,
109110
protected ImageHelper $imageHelper,
110111
protected IndexNameFetcher $indexNameFetcher,
111-
protected ReplicaManagerInterface $replicaManager
112+
protected ReplicaManagerInterface $replicaManager,
113+
protected ProductInterfaceFactory $productFactory
112114
)
113115
{
114116
parent::__construct($indexNameFetcher);
@@ -545,7 +547,7 @@ public function getParentProductIds(array $productIds): array
545547
protected function getCompositeTypes(): array
546548
{
547549
if ($this->compositeTypes === null) {
548-
$productEmulator = new DataObject();
550+
$productEmulator = $this->productFactory->create();
549551
foreach ($this->productType->getCompositeTypes() as $typeId) {
550552
$productEmulator->setTypeId($typeId);
551553
$this->compositeTypes[$typeId] = $this->productType->factory($productEmulator);

0 commit comments

Comments
 (0)