Fixed - Fatal Error when save configurable product in Magento 2.2.5 #18082 #18753
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I have checked that if there is any validation error exist then after click save button configurable-matrix data remove.You can check the file app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js in function serializeData due to fatal error comes.Now I have added condition that if there is any validation error exist then configurable-matrix data will not remove and after submit form all value will exist and product will successfully save.
Fixed Issues (if relevant)
1 - #18082: Fatal Error when save configurable product in Magento 2.2.5
Manual testing scenarios
Add new configurable product with name and sku of 63 characters length For Example: "Amzer 203877 Kristal FULL HD Tempered Glass for OnePlus 6 Clear".
Now click on "Create Configuration" button.
Now, When you try to save it's configuration, It shows client side validation error for child products SKUs. Decrease length of child product's SKUs and then save the product. It generates a error report as attached.But after apply changes product successfully saved.
Contribution checklist
Pull request has a meaningful description of its purpose
All commits are accompanied by meaningful commit messages