Skip to content

Commit

Permalink
MSI: 714: Fatal error: Uncaught TypeError: during the saving of confi…
Browse files Browse the repository at this point in the history
…gurable product
  • Loading branch information
RomaKis committed Mar 26, 2018
1 parent d557ddd commit d0dd2e7
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ define([
return Bulk.extend({
defaults: {
quantityModuleName: '',
quantity_per_source: '',
quantityPerSource: '',
exports: {
attribute: '${$.provider}:data.inventoryAttribute',
type: '${$.provider}:data.inventoryType'
Expand Down Expand Up @@ -46,7 +46,7 @@ define([
this.images = new self.makeImages(null);
this.price = self.price;
this.quantity = self.quantity;
this.quantity_per_source = self.quantity_per_source;
this.quantity_per_source = self.quantityPerSource;
};

this.initAttributeListener();
Expand All @@ -58,13 +58,13 @@ define([
* Inits listeners for attribute change.
*/
initAttributeListener: function () {
var quantity_per_source = this.sections().quantity_per_source;
var quantityPerSource = this.sections().quantity_per_source;

quantity_per_source.attribute.subscribe(function (data) {
quantityPerSource.attribute.subscribe(function (data) {
this.attribute(data);
}.bind(this));

quantity_per_source.type.subscribe(function (data) {
quantityPerSource.type.subscribe(function (data) {
this.type(data);
}.bind(this));
},
Expand Down Expand Up @@ -116,19 +116,19 @@ define([
/** @inheritdoc */
validate: function () {
var valid = true,
quantity_per_source = this.quantityResolver();
quantityPerSource = this.quantityResolver();

this._super();

if (this.type() && this.type() !== 'none') {
quantity_per_source.valid = true;
quantityPerSource.valid = true;

quantity_per_source.elems().forEach(function (item) {
quantity_per_source.validate.call(quantity_per_source, item);
quantityPerSource.elems().forEach(function (item) {
quantityPerSource.validate.call(quantityPerSource, item);
valid = valid && item.elems()[1].elems().length;
});

if (!quantity_per_source.valid || !valid) {
if (!quantityPerSource.valid || !valid) {
throw new Error($.mage.__('Please fill-in correct values.'));
}
}
Expand Down

0 comments on commit d0dd2e7

Please sign in to comment.