{"action":"created","issue":{"url":"https://api.github.com/repos/magento/magento2/issues/18221","repository_url":"https://api.github.com/repos/magento/magento2","labels_url":"https://api.github.com/repos/magento/magento2/issues/18221/labels{/name}","comments_url":"https://api.github.com/repos/magento/magento2/issues/18221/comments","events_url":"https://api.github.com/repos/magento/magento2/issues/18221/events","html_url":"https://github.com/magento/magento2/pull/18221","id":363110012,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3NjI4MzA1","number":18221,"title":"Empty option label should always be a space even if attribute is required","user":{"login":"VincentMarmiesse","id":1949412,"node_id":"MDQ6VXNlcjE5NDk0MTI=","avatar_url":"https://avatars0.githubusercontent.com/u/1949412?v=4","gravatar_id":"","url":"https://api.github.com/users/VincentMarmiesse","html_url":"https://github.com/VincentMarmiesse","followers_url":"https://api.github.com/users/VincentMarmiesse/followers","following_url":"https://api.github.com/users/VincentMarmiesse/following{/other_user}","gists_url":"https://api.github.com/users/VincentMarmiesse/gists{/gist_id}","starred_url":"https://api.github.com/users/VincentMarmiesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VincentMarmiesse/subscriptions","organizations_url":"https://api.github.com/users/VincentMarmiesse/orgs","repos_url":"https://api.github.com/users/VincentMarmiesse/repos","events_url":"https://api.github.com/users/VincentMarmiesse/events{/privacy}","received_events_url":"https://api.github.com/users/VincentMarmiesse/received_events","type":"User","site_admin":false},"labels":[{"id":374616505,"node_id":"MDU6TGFiZWwzNzQ2MTY1MDU=","url":"https://api.github.com/repos/magento/magento2/labels/Component:%20Eav","name":"Component: Eav","color":"7fb703","default":false},{"id":721429227,"node_id":"MDU6TGFiZWw3MjE0MjkyMjc=","url":"https://api.github.com/repos/magento/magento2/labels/Release%20Line:%202.3","name":"Release Line: 2.3","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":{"login":"slavvka","id":9741905,"node_id":"MDQ6VXNlcjk3NDE5MDU=","avatar_url":"https://avatars2.githubusercontent.com/u/9741905?v=4","gravatar_id":"","url":"https://api.github.com/users/slavvka","html_url":"https://github.com/slavvka","followers_url":"https://api.github.com/users/slavvka/followers","following_url":"https://api.github.com/users/slavvka/following{/other_user}","gists_url":"https://api.github.com/users/slavvka/gists{/gist_id}","starred_url":"https://api.github.com/users/slavvka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slavvka/subscriptions","organizations_url":"https://api.github.com/users/slavvka/orgs","repos_url":"https://api.github.com/users/slavvka/repos","events_url":"https://api.github.com/users/slavvka/events{/privacy}","received_events_url":"https://api.github.com/users/slavvka/received_events","type":"User","site_admin":false},"assignees":[{"login":"slavvka","id":9741905,"node_id":"MDQ6VXNlcjk3NDE5MDU=","avatar_url":"https://avatars2.githubusercontent.com/u/9741905?v=4","gravatar_id":"","url":"https://api.github.com/users/slavvka","html_url":"https://github.com/slavvka","followers_url":"https://api.github.com/users/slavvka/followers","following_url":"https://api.github.com/users/slavvka/following{/other_user}","gists_url":"https://api.github.com/users/slavvka/gists{/gist_id}","starred_url":"https://api.github.com/users/slavvka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slavvka/subscriptions","organizations_url":"https://api.github.com/users/slavvka/orgs","repos_url":"https://api.github.com/users/slavvka/repos","events_url":"https://api.github.com/users/slavvka/events{/privacy}","received_events_url":"https://api.github.com/users/slavvka/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/magento/magento2/milestones/23","html_url":"https://github.com/magento/magento2/milestone/23","labels_url":"https://api.github.com/repos/magento/magento2/milestones/23/labels","id":3664445,"node_id":"MDk6TWlsZXN0b25lMzY2NDQ0NQ==","number":23,"title":"Release: 2.3.1","description":"Community pull requests delivered to Release: 2.3.1 release","creator":{"login":"magento-engcom-team","id":31669971,"node_id":"MDQ6VXNlcjMxNjY5OTcx","avatar_url":"https://avatars1.githubusercontent.com/u/31669971?v=4","gravatar_id":"","url":"https://api.github.com/users/magento-engcom-team","html_url":"https://github.com/magento-engcom-team","followers_url":"https://api.github.com/users/magento-engcom-team/followers","following_url":"https://api.github.com/users/magento-engcom-team/following{/other_user}","gists_url":"https://api.github.com/users/magento-engcom-team/gists{/gist_id}","starred_url":"https://api.github.com/users/magento-engcom-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magento-engcom-team/subscriptions","organizations_url":"https://api.github.com/users/magento-engcom-team/orgs","repos_url":"https://api.github.com/users/magento-engcom-team/repos","events_url":"https://api.github.com/users/magento-engcom-team/events{/privacy}","received_events_url":"https://api.github.com/users/magento-engcom-team/received_events","type":"User","site_admin":false},"open_issues":87,"closed_issues":30,"state":"open","created_at":"2018-09-18T07:31:32Z","updated_at":"2018-10-02T03:54:05Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2018-09-24T11:41:40Z","updated_at":"2018-10-02T03:54:41Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/magento/magento2/pulls/18221","html_url":"https://github.com/magento/magento2/pull/18221","diff_url":"https://github.com/magento/magento2/pull/18221.diff","patch_url":"https://github.com/magento/magento2/pull/18221.patch"},"body":"### Description\r\nWhen 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.\r\n\r\nThe 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.\r\n\r\n### Manual testing scenarios\r\n#### Before this PR\r\n1. Create a dropdown attribute with some options - let's say `Option 1`, `Option 2`, `Option 3`\r\n2. Set it required\r\n3. Create a new product without touching this attribute\r\n4. The product is created with `Option 1` as value for this attribute\r\n\r\n#### After this PR\r\n1. Create a dropdown attribute with some options - let's say `Option 1`, `Option 2`, `Option 3`\r\n2. Set it required\r\n3. Create a new product without touching this attribute\r\n4. The product is not created, an error message tells this attribute is required\r\n\r\n### Contribution checklist\r\n - [X] Pull request has a meaningful description of its purpose\r\n - [X] All commits are accompanied by meaningful commit messages\r\n - [X] All new or changed code is covered with unit/integration tests (if applicable)\r\n - [X] All automated tests passed successfully (all builds on Travis CI are green)\r\n"},"comment":{"url":"https://api.github.com/repos/magento/magento2/issues/comments/426140648","html_url":"https://github.com/magento/magento2/pull/18221#issuecomment-426140648","issue_url":"https://api.github.com/repos/magento/magento2/issues/18221","id":426140648,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNjE0MDY0OA==","user":{"login":"magento-engcom-team","id":31669971,"node_id":"MDQ6VXNlcjMxNjY5OTcx","avatar_url":"https://avatars1.githubusercontent.com/u/31669971?v=4","gravatar_id":"","url":"https://api.github.com/users/magento-engcom-team","html_url":"https://github.com/magento-engcom-team","followers_url":"https://api.github.com/users/magento-engcom-team/followers","following_url":"https://api.github.com/users/magento-engcom-team/following{/other_user}","gists_url":"https://api.github.com/users/magento-engcom-team/gists{/gist_id}","starred_url":"https://api.github.com/users/magento-engcom-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magento-engcom-team/subscriptions","organizations_url":"https://api.github.com/users/magento-engcom-team/orgs","repos_url":"https://api.github.com/users/magento-engcom-team/repos","events_url":"https://api.github.com/users/magento-engcom-team/events{/privacy}","received_events_url":"https://api.github.com/users/magento-engcom-team/received_events","type":"User","site_admin":false},"created_at":"2018-10-02T03:54:41Z","updated_at":"2018-10-02T03:54:41Z","author_association":"CONTRIBUTOR","body":"Hi @slavvka, thank you for the review.\n[ENGCOM-3075](https://jira.corp.magento.com/browse/ENGCOM-3075) has been created to process this Pull Request"}}
{"actor":{"display_login":"magento-engcom-team"}}