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

Fixed issue : Trim whitespace on SKU when saving product #16572 #16592

Conversation

AnshuMishra17
Copy link
Contributor

@AnshuMishra17 AnshuMishra17 commented Jul 6, 2018

Description

Strip whitespace from the beginning and end of SKU while saving product in admin.

Fixed Issues

  1. Trim whitespace on SKU when saving product #16572: Trim whitespace on SKU when saving product

Manual testing scenarios

  1. Added new product with sku having whitespaces in beginning, at the end and at both the beginning and the end.
  2. Updated product with sku having whitespaces in beginning, at the end and at both the beginning and the end.

@magento-engcom-team
Copy link
Contributor

Hi @AnshuMishra17. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me {$VERSION} instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@VladimirZaets
Copy link
Contributor

Hi @AnshuMishra17, thank you for collaboration.
We tested your PR and we found the case where SKU isn't trimmed.

Problem: SKU isn't trimmed for configurable product options.
Manual testing scenario:

  1. Create configurable product that has SKU with whitespaces.
  2. Before save this product create configurations.
  3. Save Configurable product.

Expected result: Configurable product SKU is trimmed.
Actual result: Configurable options are saved with whitespaces.

@VladimirZaets
Copy link
Contributor

Hi @AnshuMishra17. Thanks for fixes

@VladimirZaets
Copy link
Contributor

Hi @AnshuMishra17.
We tested your PR and we found the next problem:

Problems: SKU of configurable product isn't trimmed before Configurations are generated. It caused whitespaces in SKU of generated simple products.

Manual testing scenario:
Create configurable product that has SKU with whitespaces(in the beginning and at the end).
Before save this product create configurations.
Save Configurable product.
Whitespaces are inside SKU of configurations.

@AnshuMishra17
Copy link
Contributor Author

@VladimirZaets I have added the the code to trim while simple products are generated. Where exactly these should be trimmed, means at which step child product SKU needs t o be trimmed?

@VladimirZaets
Copy link
Contributor

Hi @AnshuMishra17, with the child products all are ok, but the SKU of the configurable product itself isn't trimmed.

@AnshuMishra17
Copy link
Contributor Author

@VladimirZaets I have fixed the above mentioned issue.

@VladimirZaets
Copy link
Contributor

@AnshuMishra17 thanks

@VladimirZaets
Copy link
Contributor

Hi @AnshuMishra17. I am closing this PR because the PR #18019 provided a more complex solution for this issue, namely:

  1. Provided and used new rules for frontend validation.
  2. Worked with API calls

Thank you for collaboration.

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

Successfully merging this pull request may close these issues.

3 participants