Skip to content

Commit d74163c

Browse files
committed
ACP2E-1347: Bundle product save slow
1 parent f0cd2ff commit d74163c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/code/Magento/Bundle/Model/Option/SaveAction.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Magento\Bundle\Model\ResourceModel\Option;
1717
use Magento\Bundle\Model\ResourceModel\Option\Collection;
1818
use Magento\Catalog\Api\Data\ProductInterface;
19+
use Magento\Framework\App\ObjectManager;
1920
use Magento\Framework\EntityManager\EntityMetadataInterface;
2021
use Magento\Framework\EntityManager\MetadataPool;
2122
use Magento\Framework\Exception\CouldNotSaveException;
@@ -75,7 +76,8 @@ public function __construct(
7576
$this->metadataPool = $metadataPool;
7677
$this->type = $type;
7778
$this->linkManagement = $linkManagement;
78-
$this->addChildren = $addChildren;
79+
$this->addChildren = $addChildren ?:
80+
ObjectManager::getInstance()->get(ProductAddChildrenInterface::class);
7981
}
8082

8183
/**
@@ -213,7 +215,7 @@ private function updateOptionSelection(ProductInterface $product, OptionInterfac
213215
$linkedProduct->getSku()
214216
);
215217
}
216-
$this->addChildren->addChildren($product, $option->getOptionId(), $linksToAdd);
218+
$this->addChildren->addChildren($product, (int)$option->getOptionId(), $linksToAdd);
217219
}
218220

219221
/**

0 commit comments

Comments
 (0)