{"action":"created","issue":{"url":"https://api.github.com/repos/magento/magento2/issues/9186","repository_url":"https://api.github.com/repos/magento/magento2","labels_url":"https://api.github.com/repos/magento/magento2/issues/9186/labels{/name}","comments_url":"https://api.github.com/repos/magento/magento2/issues/9186/comments","events_url":"https://api.github.com/repos/magento/magento2/issues/9186/events","html_url":"https://github.com/magento/magento2/issues/9186","id":220582874,"number":9186,"title":"REST API catalogProductRepositoryV1 overwriting default values","user":{"login":"giano574","id":17013720,"avatar_url":"https://avatars1.githubusercontent.com/u/17013720?v=4","gravatar_id":"","url":"https://api.github.com/users/giano574","html_url":"https://github.com/giano574","followers_url":"https://api.github.com/users/giano574/followers","following_url":"https://api.github.com/users/giano574/following{/other_user}","gists_url":"https://api.github.com/users/giano574/gists{/gist_id}","starred_url":"https://api.github.com/users/giano574/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giano574/subscriptions","organizations_url":"https://api.github.com/users/giano574/orgs","repos_url":"https://api.github.com/users/giano574/repos","events_url":"https://api.github.com/users/giano574/events{/privacy}","received_events_url":"https://api.github.com/users/giano574/received_events","type":"User","site_admin":false},"labels":[{"id":429635502,"url":"https://api.github.com/repos/magento/magento2/labels/2.1.x","name":"2.1.x","color":"fbca04","default":false},{"id":147131376,"url":"https://api.github.com/repos/magento/magento2/labels/bug%20report","name":"bug report","color":"d93f0b","default":false},{"id":688811200,"url":"https://api.github.com/repos/magento/magento2/labels/G1%20Passed","name":"G1 Passed","color":"0e8a16","default":false},{"id":161563561,"url":"https://api.github.com/repos/magento/magento2/labels/needs%20update","name":"needs update","color":"b60205","default":false},{"id":373917120,"url":"https://api.github.com/repos/magento/magento2/labels/WebAPI","name":"WebAPI","color":"1d76db","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-04-10T09:14:38Z","updated_at":"2017-09-11T20:24:34Z","closed_at":"2017-09-11T20:24:34Z","author_association":"NONE","body":"<!--- Provide a general summary of the issue in the Title above -->\r\n<!--- Before adding new issues, please, check this article https://github.com/magento/magento2/wiki/Issue-reporting-guidelines-->\r\n\r\n# Preconditions\r\n<!--- Provide a more detailed information of environment you use -->\r\n<!--- Magento version, tag, HEAD, etc., PHP & MySQL version, etc.. -->\r\n1. Magento 2.1.4\r\n2. PHP 7.0.15\r\n3. MySQL 5.6\r\n4. Website/store configuration:\r\n\r\nWebsite | Store | Store view\r\n------------ | ------------- | ------------- \r\nDanish (id: 2) | Danish Store (id: 2) | Store view (Danish)\r\nEnglish (id: 1) | English Store (id: 3) | Store View (English)\r\n\r\n# Steps to reproduce\r\n<!--- Provide a set of unambiguous steps to reproduce this bug include code, if relevant  -->\r\n\r\n## REST product\r\n1. POST the following JSON to {domain.com}/rest/V1/products (catalogProductRepositoryV1) - product status set to 2 (disabled):\r\n```\r\n{\r\n\t\"saveOptions\": true,\r\n\t\"product\": {\r\n\t\t\"attribute_set_id\": 10,\r\n\t\t\"visibility\": 4,\r\n\t\t\"price\": 120,\r\n\t\t\"type_id\": \"virtual\",\r\n\t\t\"name\": \"Rest product\",\r\n\t\t\"extension_attributes\": {\r\n\t\t\t\"stock_item\": {\r\n\t\t\t\t\"manage_stock\": false,\r\n\t\t\t\t\"is_in_stock\": true,\r\n\t\t\t\t\"use_config_manage_stock\": false\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"sku\": \"TK207582890\",\r\n\t\t\"status\": 2\r\n\t}\r\n}\r\n```\r\n\r\n2. Inspect the database with the following two queries:\r\n```\r\nSELECT \r\n    attribute_id\r\nFROM \r\n    eav_attribute\r\nWHERE\r\n    attribute_code = 'status' AND \r\n    entity_type_id = (SELECT \r\n                entity_type_id \r\n              FROM \r\n                eav_entity_type\r\n              WHERE\r\n                entity_type_code = 'catalog_product'\r\n            )\r\n```\r\n3. Use value from step 2 (I got 97) in the next query:\r\n```\r\nSELECT * FROM \r\n    catalog_product_entity_int\r\nWHERE \r\n    attribute_id = 97\r\n```\r\n\r\n# Expected result\r\n<!--- Tell us what should happen -->\r\n1. There should only be one row in the database with the default value (2) for the status and store id of 0.\r\n# Actual result\r\n<!--- Tell us what happens instead -->\r\n1. There are **TWO** rows. One for the store with id 0 (admin) and one the Danish Store. This means that the Store View (Danish) does not use the default values for status (as well as other attributes), and there is no way to make it use the default values other than manually editing it in the admin or by deleting the row in the database.\r\n\r\n### Database result\r\n![db result](https://www.dropbox.com/s/wtzroyur5reccc4/db.png?dl=1)\r\n\r\n<!--- (This may be platform independent comment) -->\r\n"},"comment":{"url":"https://api.github.com/repos/magento/magento2/issues/comments/328647995","html_url":"https://github.com/magento/magento2/issues/9186#issuecomment-328647995","issue_url":"https://api.github.com/repos/magento/magento2/issues/9186","id":328647995,"user":{"login":"magento-engcom-team","id":31669971,"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":"2017-09-11T20:24:34Z","updated_at":"2017-09-11T20:24:34Z","author_association":"NONE","body":"@giano574 we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue."}}
{"actor":{"display_login":"magento-engcom-team"}}