{"action":"opened","issue":{"url":"https://api.github.com/repos/divio/django-cms/issues/5260","repository_url":"https://api.github.com/repos/divio/django-cms","labels_url":"https://api.github.com/repos/divio/django-cms/issues/5260/labels{/name}","comments_url":"https://api.github.com/repos/divio/django-cms/issues/5260/comments","events_url":"https://api.github.com/repos/divio/django-cms/issues/5260/events","html_url":"https://github.com/divio/django-cms/issues/5260","id":153794671,"number":5260,"title":"3.2.x bug with moving a page","user":{"login":"czpython","id":994951,"avatar_url":"https://avatars.githubusercontent.com/u/994951?v=3","gravatar_id":"","url":"https://api.github.com/users/czpython","html_url":"https://github.com/czpython","followers_url":"https://api.github.com/users/czpython/followers","following_url":"https://api.github.com/users/czpython/following{/other_user}","gists_url":"https://api.github.com/users/czpython/gists{/gist_id}","starred_url":"https://api.github.com/users/czpython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czpython/subscriptions","organizations_url":"https://api.github.com/users/czpython/orgs","repos_url":"https://api.github.com/users/czpython/repos","events_url":"https://api.github.com/users/czpython/events{/privacy}","received_events_url":"https://api.github.com/users/czpython/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-09T14:51:19Z","updated_at":"2016-05-09T14:51:19Z","closed_at":null,"body":"Moving a page to the root of pages can result in a 500 error under the following circumstances reported by @mkoistinen \r\n\r\n* Add 4 pages nested within each other so that Alpha is the parent of Beta which is the parent of Gamma which is the parent of Delta.\r\n* Publish each page.\r\n* Move Beta to beneath Alpha but at the root.\r\n\r\nThe error is caused by [this line](https://github.com/FinalAngel/django-cms/pull/120/files#diff-c0756a8caedaec348582d90875a15194R896).\r\n\r\nCalling ``get_last_root_node`` can result in a draft or live page, so certain operations like moving a page that assume the passed page is a draft, will fail and potentially corrupt the tree because it can result in operations being done directly to the live page vs the intended draft page."}}