-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix adding an option with label '0' #34578
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
Fix adding an option with label '0' #34578
Conversation
Fix adding an attribute option to a product with the label '0'
Hi @mbijnsdorp. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review. For more details, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
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.
Hi @mbijnsdorp,
Your changes look good to me.
Could you cover your changes with some automated tests?
Hi @ihor-sviziev, |
Hi @mbijnsdorp, thank you for your contribution. The existing test you mentioned, is a good place to cover your case. I'd suggest adding a simple dataProvider, that will provide different options labels to the magento2/app/code/Magento/Customer/Test/Unit/Block/Widget/NameTest.php Lines 179 to 211 in f3e8f25
Please let me know if you have any questions. Thank you. |
Hi @eduard13, thank you for the pointers. I've updated the test with a data provider based on the given example. Please let me know if it requires any other changes. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Unit Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Functional Tests CE, Functional Tests EE |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Apply suggestions from code review
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@ihor-sviziev Could you also add the partner Youwe label? |
@sidolov @sivaschenko, could you check why the partner label wasn't applied? |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
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.
@mbijnsdorp, great job! Thank you for your contribution!
✔ Approved
Hi @ihor-sviziev, thank you for the review. |
@mbijnsdorp thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
@ihor-sviziev label wasn't added because @mbijnsdorp is not a part of Youwe team on the GitHub |
✔️ QA Passed Manual testing scenario:
Before: ✖️ Exception is throwing with message ‘The attribute option label is empty. Enter the value and try again.’ After: ✔️ The code run successfully without expection. |
Description (*)
When adding an option to an attribute programmatically via
\Magento\Eav\Model\Entity\Attribute\OptionManagement::add
, it's not possible to use the label '0' for the option.Contribution checklist (*)