-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Empty option label should always be a space even if attribute is required #18221
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
Empty option label should always be a space even if attribute is required #18221
Conversation
Hi @VincentMarmiesse. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
@magento-engcom-team give me test instance |
Hi @VincentMarmiesse. Thank you for your request. I'm working on Magento instance for you |
Hi @VincentMarmiesse, here is your new Magento instance. |
@magento-engcom-team give me 2.3-develop instance |
Hi @VincentMarmiesse. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @VincentMarmiesse, here is your Magento instance. |
4f29b7c
to
24055c5
Compare
Hi @slavvka, Please tell me if you want me to do some modifications. |
Hi @VincentMarmiesse. There was recently introduced a new docblock validator which is run again changeset. That is why other classes which weren't touched don't have the same issues. I would appreciate if you added a description for this class. Please come up with its name on your own since you are aware what it is designed for. Thank you! |
@VincentMarmiesse you could refer to this guide https://devdocs.magento.com/guides/v2.2/coding-standards/docblock-standard-general.html |
24055c5
to
5b6152d
Compare
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.
Thank you!
Hi @slavvka, thank you for the review. |
…ibute is required #18221
Hi @VincentMarmiesse. Thank you for your contribution. |
Description
When adding an empty option, Magento checks if the attribute is required or not. If it's not required, it adds an empty option with a space label (
), but if it's required it adds an empty option without label.
The issue is when an attribute is required, the empty option is not selected by default, it's the first option. It causes some issues because if the admin does not pay attention, he/she will save the product with the first option. That's not what is expected, we want an error message telling this attribute is required.
Manual testing scenarios
Before this PR
Option 1
,Option 2
,Option 3
Option 1
as value for this attributeAfter this PR
Option 1
,Option 2
,Option 3
Contribution checklist