Skip to content
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

Merged
merged 14 commits into from
Mar 28, 2018

Conversation

RomaKis
Copy link
Contributor

@RomaKis RomaKis commented Mar 24, 2018

…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
@RomaKis RomaKis added the WIP label Mar 24, 2018
@RomaKis RomaKis removed the WIP label Mar 26, 2018
/**
* Make options sections.
*/
this.makeOptionSections = function () {
Copy link
Contributor

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.

Copy link
Contributor Author

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';
Copy link
Contributor

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.

Copy link
Contributor Author

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;
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants