{"action":"created","issue":{"url":"https://api.github.com/repos/strapi/strapi/issues/711","repository_url":"https://api.github.com/repos/strapi/strapi","labels_url":"https://api.github.com/repos/strapi/strapi/issues/711/labels{/name}","comments_url":"https://api.github.com/repos/strapi/strapi/issues/711/comments","events_url":"https://api.github.com/repos/strapi/strapi/issues/711/events","html_url":"https://github.com/strapi/strapi/issues/711","id":300841931,"number":711,"title":"OneToOne relation only deleted on one side after edit","user":{"login":"TheWebsDoor","id":3693028,"avatar_url":"https://avatars3.githubusercontent.com/u/3693028?v=4","gravatar_id":"","url":"https://api.github.com/users/TheWebsDoor","html_url":"https://github.com/TheWebsDoor","followers_url":"https://api.github.com/users/TheWebsDoor/followers","following_url":"https://api.github.com/users/TheWebsDoor/following{/other_user}","gists_url":"https://api.github.com/users/TheWebsDoor/gists{/gist_id}","starred_url":"https://api.github.com/users/TheWebsDoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheWebsDoor/subscriptions","organizations_url":"https://api.github.com/users/TheWebsDoor/orgs","repos_url":"https://api.github.com/users/TheWebsDoor/repos","events_url":"https://api.github.com/users/TheWebsDoor/events{/privacy}","received_events_url":"https://api.github.com/users/TheWebsDoor/received_events","type":"User","site_admin":false},"labels":[{"id":749108670,"url":"https://api.github.com/repos/strapi/strapi/labels/priority:%20high","name":"priority: high","color":"e8591e","default":false},{"id":783919370,"url":"https://api.github.com/repos/strapi/strapi/labels/status:%20confirmed%20%F0%9F%91%8D","name":"status: confirmed 👍","color":"215cea","default":false},{"id":267208743,"url":"https://api.github.com/repos/strapi/strapi/labels/type:%20bug%20%F0%9F%90%9B","name":"type: bug 🐛","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":{"login":"lauriejim","id":5716596,"avatar_url":"https://avatars3.githubusercontent.com/u/5716596?v=4","gravatar_id":"","url":"https://api.github.com/users/lauriejim","html_url":"https://github.com/lauriejim","followers_url":"https://api.github.com/users/lauriejim/followers","following_url":"https://api.github.com/users/lauriejim/following{/other_user}","gists_url":"https://api.github.com/users/lauriejim/gists{/gist_id}","starred_url":"https://api.github.com/users/lauriejim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lauriejim/subscriptions","organizations_url":"https://api.github.com/users/lauriejim/orgs","repos_url":"https://api.github.com/users/lauriejim/repos","events_url":"https://api.github.com/users/lauriejim/events{/privacy}","received_events_url":"https://api.github.com/users/lauriejim/received_events","type":"User","site_admin":false},"assignees":[{"login":"lauriejim","id":5716596,"avatar_url":"https://avatars3.githubusercontent.com/u/5716596?v=4","gravatar_id":"","url":"https://api.github.com/users/lauriejim","html_url":"https://github.com/lauriejim","followers_url":"https://api.github.com/users/lauriejim/followers","following_url":"https://api.github.com/users/lauriejim/following{/other_user}","gists_url":"https://api.github.com/users/lauriejim/gists{/gist_id}","starred_url":"https://api.github.com/users/lauriejim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lauriejim/subscriptions","organizations_url":"https://api.github.com/users/lauriejim/orgs","repos_url":"https://api.github.com/users/lauriejim/repos","events_url":"https://api.github.com/users/lauriejim/events{/privacy}","received_events_url":"https://api.github.com/users/lauriejim/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-02-28T00:08:57Z","updated_at":"2018-03-01T17:03:36Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"**Node.js version**:\r\n8.9.3\r\n**npm version**:\r\n5.5.1\r\n**Strapi version**:\r\n3.0.0-alpha.10.2\r\n**Operating system**:\r\nMacOS 10.13.3\r\n\r\n**Do you want to request a *feature* or report a *bug*?**\r\n*bug*\r\n\r\n**What is the current behavior?**\r\nWhen we save an object which have a OneToOne relation with another, the relation is saved on both sides the first time but when we go back on the object and try to edit (with keeping the relation), it will delete relation on one side (strange but on the other entity, the relation is keeped but not on the edited one).\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce the problem**\r\nCreate two entities (for example Book and Category) and create a OneToOne relation between them.\r\nAdd a new Category.\r\nAdd a new Book with the Category previously created.\r\nEdit the book just created. You'll notice that the relation with its category is good. But try now to edit the name of the book, keep the relation and click on save.\r\nEdit it again, you'll see that the relation disappeared. And even if I try to put it back, it won't work anymore... I have to delete the book to re-create it if I want the relation back.\r\n\r\nCategory created:\r\n![capture d ecran 2018-02-27 a 19 05 07](https://user-images.githubusercontent.com/3693028/36762408-510341a0-1bf1-11e8-90c6-db530feeb8e6.png)\r\n\r\nAdd new book:\r\n![capture d ecran 2018-02-27 a 19 05 16](https://user-images.githubusercontent.com/3693028/36762414-5acd6cc4-1bf1-11e8-8fd5-0b925485c399.png)\r\n\r\nFirst time edit just created book:\r\n![capture d ecran 2018-02-27 a 19 05 24](https://user-images.githubusercontent.com/3693028/36762419-62a7ad38-1bf1-11e8-97d6-e9bfff113520.png)\r\n\r\nClick on Save.\r\n\r\nThen, we I try to edit it again, relation disappeared...\r\n![capture d ecran 2018-02-27 a 19 05 33](https://user-images.githubusercontent.com/3693028/36762429-708d8634-1bf1-11e8-9801-1781a87367c5.png)\r\n\r\nThat is strange is that the relation still exists on the Category object... And it's not just a front display bug because even in the api we have the relation on only one side.\r\n\r\n**What is the expected behavior?**\r\nWhen we edit an object with a relation, the relation have to remain the same."},"comment":{"url":"https://api.github.com/repos/strapi/strapi/issues/comments/369659908","html_url":"https://github.com/strapi/strapi/issues/711#issuecomment-369659908","issue_url":"https://api.github.com/repos/strapi/strapi/issues/711","id":369659908,"user":{"login":"lauriejim","id":5716596,"avatar_url":"https://avatars3.githubusercontent.com/u/5716596?v=4","gravatar_id":"","url":"https://api.github.com/users/lauriejim","html_url":"https://github.com/lauriejim","followers_url":"https://api.github.com/users/lauriejim/followers","following_url":"https://api.github.com/users/lauriejim/following{/other_user}","gists_url":"https://api.github.com/users/lauriejim/gists{/gist_id}","starred_url":"https://api.github.com/users/lauriejim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lauriejim/subscriptions","organizations_url":"https://api.github.com/users/lauriejim/orgs","repos_url":"https://api.github.com/users/lauriejim/repos","events_url":"https://api.github.com/users/lauriejim/events{/privacy}","received_events_url":"https://api.github.com/users/lauriejim/received_events","type":"User","site_admin":false},"created_at":"2018-03-01T17:03:36Z","updated_at":"2018-03-01T17:03:36Z","author_association":"OWNER","body":"After pulling master I tried to reproduce the issue but it works fine. I think @Aurelsicoko fixed it working on polymorphic relations.\r\nMaybe you will confirm it work on your side too."}}
{"actor":{"display_login":"lauriejim"}}