-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPAR-197] created patch by pull magento/magento2#16838
- Loading branch information
maksim
committed
Aug 28, 2019
1 parent
9536715
commit 21a6bbb
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
Patch-Magento-Catalog-M2.1.x-2.2.7-fix-save-customizable-options.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- Model/Product/Option/Value.origin.php 2018-06-14 15:32:00.000000000 +0300 | ||
+++ Model/Product/Option/Value.php 2019-08-28 13:08:18.000000000 +0300 | ||
@@ -204,27 +204,26 @@ | ||
public function saveValues() | ||
{ | ||
foreach ($this->getValues() as $value) { | ||
- $this->isDeleted(false); | ||
- $this->setData( | ||
+ $optionValue = clone $this; | ||
+ $optionValue->isDeleted(false); | ||
+ $optionValue->setData( | ||
$value | ||
)->setData( | ||
'option_id', | ||
- $this->getOption()->getId() | ||
+ $optionValue->getOption()->getId() | ||
)->setData( | ||
'store_id', | ||
- $this->getOption()->getStoreId() | ||
+ $optionValue->getOption()->getStoreId() | ||
); | ||
- | ||
- if ($this->getData('is_delete') == '1') { | ||
- if ($this->getId()) { | ||
- $this->deleteValues($this->getId()); | ||
- $this->delete(); | ||
+ if ($optionValue->getData('is_delete') == '1') { | ||
+ if ($optionValue->getId()) { | ||
+ $optionValue->deleteValues($optionValue->getId()); | ||
+ $optionValue->delete(); | ||
} | ||
} else { | ||
- $this->save(); | ||
+ $optionValue->save(); | ||
} | ||
} | ||
- //eof foreach() | ||
return $this; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters