-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
714: Fatal error: Uncaught TypeError: during the saving of configurable product #753
Conversation
…gurable product MSI: 714: Fatal error: Uncaught TypeError: during the saving of configurable product MSI: 714: Fatal error: Uncaught TypeError: during the saving of configurable product
# Conflicts: # app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/dynamic-rows-configurable.js # app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/summary.js
/** | ||
* Make options sections. | ||
*/ | ||
this.makeOptionSections = function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I see, this function we use only one time. Please rewrite her without using self
variable. You can bind context and return the new object.
this.makeOptionSelections = function(){...}.bind(this);
return {
images: this.makeImages(null),
price: this.price,
quantityPerSource = this.quantityPerSource
}
And use her without new
, as a simple function instead of a constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
/** @inheritdoc */ | ||
initObservable: function () { | ||
this._super(); | ||
this.quantityFieldName = 'quantityPerSource'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move configuration to defaults
block. Also, you use initObserveble
method don't by purpose. In initObserveble
you should declare observable variables and arrays, in other cases, you should use initialize
or initConfig
methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Fixed.
getProductData: function (row) { | ||
var product = this._super(row); | ||
|
||
product['quantity_per_source'] = row.quantityPerSource; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move name of quantity field to defaults
block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Fixed Issues (if relevant)