{"action":"created","issue":{"url":"https://api.github.com/repos/metabase/metabase/issues/5453","repository_url":"https://api.github.com/repos/metabase/metabase","labels_url":"https://api.github.com/repos/metabase/metabase/issues/5453/labels{/name}","comments_url":"https://api.github.com/repos/metabase/metabase/issues/5453/comments","events_url":"https://api.github.com/repos/metabase/metabase/issues/5453/events","html_url":"https://github.com/metabase/metabase/issues/5453","id":241967427,"number":5453,"title":"Editing a question takes it out of the collection","user":{"login":"ricardojmendez","id":31263,"avatar_url":"https://avatars2.githubusercontent.com/u/31263?v=3","gravatar_id":"","url":"https://api.github.com/users/ricardojmendez","html_url":"https://github.com/ricardojmendez","followers_url":"https://api.github.com/users/ricardojmendez/followers","following_url":"https://api.github.com/users/ricardojmendez/following{/other_user}","gists_url":"https://api.github.com/users/ricardojmendez/gists{/gist_id}","starred_url":"https://api.github.com/users/ricardojmendez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricardojmendez/subscriptions","organizations_url":"https://api.github.com/users/ricardojmendez/orgs","repos_url":"https://api.github.com/users/ricardojmendez/repos","events_url":"https://api.github.com/users/ricardojmendez/events{/privacy}","received_events_url":"https://api.github.com/users/ricardojmendez/received_events","type":"User","site_admin":false},"labels":[{"id":172924550,"url":"https://api.github.com/repos/metabase/metabase/labels/Bug","name":"Bug","color":"CC333F","default":false},{"id":461767129,"url":"https://api.github.com/repos/metabase/metabase/labels/Saved%20Questions","name":"Saved Questions","color":"1457AD","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-11T08:30:45Z","updated_at":"2017-07-11T17:09:49Z","closed_at":null,"body":"To reproduce:\r\n\r\n- Edit a question that's in a collection\r\n- Change the database (for instance, if you're switching from a live to a reporting database)\r\n- Save while Replacing the original question\r\n\r\nThe new question will not be on the same collection as the original one, will not have one at all."},"comment":{"url":"https://api.github.com/repos/metabase/metabase/issues/comments/314510501","html_url":"https://github.com/metabase/metabase/issues/5453#issuecomment-314510501","issue_url":"https://api.github.com/repos/metabase/metabase/issues/5453","id":314510501,"user":{"login":"camsaul","id":1455846,"avatar_url":"https://avatars0.githubusercontent.com/u/1455846?v=3","gravatar_id":"","url":"https://api.github.com/users/camsaul","html_url":"https://github.com/camsaul","followers_url":"https://api.github.com/users/camsaul/followers","following_url":"https://api.github.com/users/camsaul/following{/other_user}","gists_url":"https://api.github.com/users/camsaul/gists{/gist_id}","starred_url":"https://api.github.com/users/camsaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camsaul/subscriptions","organizations_url":"https://api.github.com/users/camsaul/orgs","repos_url":"https://api.github.com/users/camsaul/repos","events_url":"https://api.github.com/users/camsaul/events{/privacy}","received_events_url":"https://api.github.com/users/camsaul/received_events","type":"User","site_admin":false},"created_at":"2017-07-11T17:09:49Z","updated_at":"2017-07-11T17:09:49Z","body":"Yikes\r\n\r\n@metabase/core-developers @attekei \r\nThe backend assumes if you pass in `:collection_id nil` to the edit Question endpoint that you want to remove it from its collection. I'm guessing that's what's happening. We need to either:\r\n\r\n1.  Make sure we don't pass a `:collection_id` key when we don't want to modify it (the backend will only remove a Question from a collection if `:collection_id` is passed as `:null`), or\r\n2.  Make sure when we call the endpoint we're also passing the original `:collection_id` as well.\r\n\r\nBasically the idea is either pass the existing value back or don't pass it at all, but whatever you do *don't* pass a different value back, which is what it sounds like is happening. This must be some weird edge case that's happening when the database is switched (perhaps some state containing `:collection_id` is getting cleared out?)"}}
{"actor":{"display_login":"camsaul"}}