Skip to content

Commit 86ad99f

Browse files
author
Oleksandr Iegorov
committed
MAGETWO-69496: Impossible specify Bundle option title on store view level with changes to more than one store view
1 parent 681c218 commit 86ad99f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

app/code/Magento/Bundle/Model/Product/SaveHandler.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Magento\Bundle\Api\ProductOptionRepositoryInterface as OptionRepository;
99
use Magento\Bundle\Api\ProductLinkManagementInterface;
1010
use Magento\Framework\EntityManager\Operation\ExtensionInterface;
11+
use Magento\Catalog\Api\Data\ProductInterface;
1112

1213
/**
1314
* Class SaveHandler
@@ -39,7 +40,7 @@ public function __construct(
3940
/**
4041
* @param object $entity
4142
* @param array $arguments
42-
* @return \Magento\Catalog\Api\Data\ProductInterface|object
43+
* @return ProductInterface|object
4344
* @throws \Magento\Framework\Exception\NoSuchEntityException
4445
* @throws \Magento\Framework\Exception\InputException
4546
* @throws \Magento\Framework\Exception\CouldNotSaveException
@@ -65,7 +66,7 @@ public function execute($entity, $arguments = [])
6566

6667
if (!$entity->getCopyFromView()) {
6768
$this->processRemovedOptions($entity->getSku(), $existingOptionsIds, $optionIds);
68-
$this->processExistedOptions($entity->getSku(), $existingOptionsIds, $optionIds);
69+
$this->processExistingOptions($entity->getSku(), $existingOptionsIds, $optionIds);
6970

7071
$newOptionsIds = array_diff($optionIds, $existingOptionsIds);
7172
$this->saveOptions($entity, $options, $newOptionsIds);
@@ -97,14 +98,14 @@ protected function removeOptionLinks($entitySku, $option)
9798
/**
9899
* Perform save for all options entities
99100
*
100-
* @param object $entity
101+
* @param ProductInterface $entity
101102
* @param array $options
102103
* @param array $newOptionsIds
103104
* @throws \Magento\Framework\Exception\CouldNotSaveException
104105
* @throws \Magento\Framework\Exception\InputException
105106
* @return void
106107
*/
107-
private function saveOptions($entity, array $options, array $newOptionsIds = [])
108+
private function saveOptions(ProductInterface $entity, array $options, array $newOptionsIds = [])
108109
{
109110
foreach ($options as $option) {
110111
if (in_array($option->getOptionId(), $newOptionsIds, true)) {
@@ -158,7 +159,7 @@ private function processRemovedOptions($entitySku, array $existingOptionsIds, ar
158159
}
159160

160161
/**
161-
* Removes option links for existed options
162+
* Removes option links for existing options
162163
*
163164
* @param string $entitySku
164165
* @param array $existingOptionsIds
@@ -167,7 +168,7 @@ private function processRemovedOptions($entitySku, array $existingOptionsIds, ar
167168
* @throws \Magento\Framework\Exception\InputException
168169
* @return void
169170
*/
170-
private function processExistedOptions($entitySku, array $existingOptionsIds, array $optionIds)
171+
private function processExistingOptions($entitySku, array $existingOptionsIds, array $optionIds)
171172
{
172173
foreach (array_intersect($optionIds, $existingOptionsIds) as $optionId) {
173174
$option = $this->optionRepository->get($entitySku, $optionId);

0 commit comments

Comments
 (0)