Skip to content

Commit ff42200

Browse files
[BUGFIX] All option values were deleted if one was deleted earlier
The problem occurs if you delete one custom option value was deleted. This occurred because the same value object is used for saving all values, and if one value is deleted the _isDeleted flag is set tot true on that object. So all values after that value will also be deleted.
1 parent f2f94cf commit ff42200

File tree

1 file changed

+2
-1
lines changed
  • app/code/Magento/Catalog/Model/Product/Option

1 file changed

+2
-1
lines changed

app/code/Magento/Catalog/Model/Product/Option/Value.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ public function getProduct()
189189
*/
190190
public function saveValues()
191191
{
192-
foreach ($this->getValues() as $value) {
192+
foreach ($this->getValues() as $value)
193+
$this->isDeleted(false);
193194
$this->setData(
194195
$value
195196
)->setData(

0 commit comments

Comments
 (0)