From b3b6c90480942d7b56a398e33d1ce0a357358997 Mon Sep 17 00:00:00 2001 From: Pedro Sousa Date: Fri, 8 Feb 2019 17:15:22 +0100 Subject: [PATCH 1/3] Turn on edit mode for product repository when adding children This should fix the issue with the configurable products not having any options with Bulk and Async API. Related issue: https://github.com/magento/magento2/issues/20366 --- app/code/Magento/ConfigurableProduct/Model/LinkManagement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php b/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php index 79c2dd812acf1..06b49d356c5ee 100644 --- a/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php +++ b/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php @@ -111,7 +111,7 @@ public function getChildren($sku) */ public function addChild($sku, $childSku) { - $product = $this->productRepository->get($sku); + $product = $this->productRepository->get($sku, true); $child = $this->productRepository->get($childSku); $childrenIds = array_values($this->configurableType->getChildrenIds($product->getId())[0]); From a7f03dd4f2ec0927e913c753a9b178394b5cd542 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Mon, 1 Apr 2019 16:30:18 +0300 Subject: [PATCH 2/3] magento/magento2#21083: Static test fix. --- .../ConfigurableProduct/Model/LinkManagement.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php b/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php index 06b49d356c5ee..75cab12f63562 100644 --- a/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php +++ b/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php @@ -1,6 +1,5 @@ Date: Tue, 2 Apr 2019 10:24:26 +0300 Subject: [PATCH 3/3] magento/magento2#21083: Static test fix. --- .../ConfigurableProduct/Model/LinkManagement.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php b/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php index 75cab12f63562..2f07f8b90ce7e 100644 --- a/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php +++ b/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php @@ -12,6 +12,8 @@ /** * Configurable product link management. + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class LinkManagement implements \Magento\ConfigurableProduct\Api\LinkManagementInterface { @@ -110,6 +112,10 @@ public function getChildren($sku) /** * @inheritdoc + * @throws InputException + * @throws NoSuchEntityException + * @throws StateException + * @throws \Magento\Framework\Exception\CouldNotSaveException */ public function addChild($sku, $childSku) { @@ -153,6 +159,10 @@ public function addChild($sku, $childSku) /** * @inheritdoc + * @throws InputException + * @throws NoSuchEntityException + * @throws StateException + * @throws \Magento\Framework\Exception\CouldNotSaveException */ public function removeChild($sku, $childSku) {