Skip to content

Commit c26b3a7

Browse files
committed
MC-5498: Error when save configurable product
1 parent 1bb12ff commit c26b3a7

File tree

1 file changed

+9
-6
lines changed
  • app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations

1 file changed

+9
-6
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,11 @@ define([
387387

388388
if (this.checkForNewAttributes()) {
389389
this.formSaveParams = arguments;
390-
this.attributeSetHandlerModal().openModal().then(_.bind(this.unserializeData, this));
390+
this.attributeSetHandlerModal().openModal();
391391
} else {
392392
this.formElement().save(arguments[0], arguments[1]);
393393

394-
if (this.source.params.invalid) {
394+
if (this.formElement().source.get('params.invalid')) {
395395
this.unserializeData();
396396
}
397397
}
@@ -466,20 +466,20 @@ define([
466466
* @returns {Boolean}
467467
*/
468468
addNewAttributeSetHandler: function () {
469-
var choosenAttributeSetOption;
469+
var chosenAttributeSetOption;
470470

471471
this.formElement().validate();
472472

473473
if (this.formElement().source.get('params.invalid') === false) {
474-
choosenAttributeSetOption = this.attributeSetSelection;
474+
chosenAttributeSetOption = this.attributeSetSelection;
475475

476-
if (choosenAttributeSetOption === 'new') {
476+
if (chosenAttributeSetOption === 'new') {
477477
this.createNewAttributeSet();
478478

479479
return false;
480480
}
481481

482-
if (choosenAttributeSetOption === 'existing') {
482+
if (chosenAttributeSetOption === 'existing') {
483483
this.set(
484484
'skeletonAttributeSet',
485485
this.attributeSetId
@@ -489,6 +489,9 @@ define([
489489
this.closeDialogAndProcessForm();
490490

491491
return true;
492+
} else {
493+
this.unserializeData();
494+
return false;
492495
}
493496
},
494497

0 commit comments

Comments
 (0)