Skip to content

Commit bc00d8e

Browse files
author
al.kravchuk
committed
#13177: Can't save attributes on a configurable product.
- fix error while saving configurable product after validation error.
1 parent d866b18 commit bc00d8e

File tree

1 file changed

+10
-8
lines changed
  • app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations

1 file changed

+10
-8
lines changed

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -407,15 +407,17 @@ define([
407407
* - associated_product_ids_serialized.
408408
*/
409409
serializeData: function () {
410-
this.source.data['configurable-matrix-serialized'] =
411-
JSON.stringify(this.source.data['configurable-matrix']);
412-
413-
delete this.source.data['configurable-matrix'];
414-
415-
this.source.data['associated_product_ids_serialized'] =
416-
JSON.stringify(this.source.data['associated_product_ids']);
410+
if (this.source.data['configurable-matrix']) {
411+
this.source.data['configurable-matrix-serialized'] =
412+
JSON.stringify(this.source.data['configurable-matrix']);
413+
delete this.source.data['configurable-matrix'];
414+
}
417415

418-
delete this.source.data['associated_product_ids'];
416+
if (this.source.data['associated_product_ids']) {
417+
this.source.data['associated_product_ids_serialized'] =
418+
JSON.stringify(this.source.data['associated_product_ids']);
419+
delete this.source.data['associated_product_ids'];
420+
}
419421
},
420422

421423
/**

0 commit comments

Comments
 (0)