{"action":"created","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4170","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4170/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4170/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4170/events","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/4170","id":74028753,"number":4170,"title":"Store current page before marking tree nodes (fixes #4137, fixes silverstripe/silverstripe-cms#1135)","user":{"login":"kinglozzer","id":1655548,"avatar_url":"https://avatars.githubusercontent.com/u/1655548?v=3","gravatar_id":"","url":"https://api.github.com/users/kinglozzer","html_url":"https://github.com/kinglozzer","followers_url":"https://api.github.com/users/kinglozzer/followers","following_url":"https://api.github.com/users/kinglozzer/following{/other_user}","gists_url":"https://api.github.com/users/kinglozzer/gists{/gist_id}","starred_url":"https://api.github.com/users/kinglozzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinglozzer/subscriptions","organizations_url":"https://api.github.com/users/kinglozzer/orgs","repos_url":"https://api.github.com/users/kinglozzer/repos","events_url":"https://api.github.com/users/kinglozzer/events{/privacy}","received_events_url":"https://api.github.com/users/kinglozzer/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-07T15:34:16Z","updated_at":"2015-06-09T21:28:42Z","closed_at":"2015-06-09T21:18:05Z","pull_request":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/4170","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/4170","diff_url":"https://github.com/silverstripe/silverstripe-framework/pull/4170.diff","patch_url":"https://github.com/silverstripe/silverstripe-framework/pull/4170.patch"},"body":"Well, this was an easier solution than I expected!\r\n\r\nCode docs should explain this well enough, but basically:\r\n\r\n- Without `$obj->markToExpose()`, the tree view fails to load with the current page highlighted under the conditions described in [this issue](https://github.com/silverstripe/silverstripe-cms/issues/1135). It then tries to load `getsubtree?ID=0&ajax=1` before collapsing _fully_ (all the way down to the root “your site name” node), making it very difficult to then find the current page;\r\n- With `$obj->markToExpose()` uncommented where it was, [this issue](https://github.com/silverstripe/silverstripe-cms/issues/1049) re-occurs;\r\n- By moving `$this->currentPage()` before `$obj->markToExpose()`, the deleted pages in `Hierarchy::$marked` aren’t wiped, fixing both issues"},"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/comments/110508907","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/4170#issuecomment-110508907","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4170","id":110508907,"user":{"login":"jonom","id":1079425,"avatar_url":"https://avatars.githubusercontent.com/u/1079425?v=3","gravatar_id":"","url":"https://api.github.com/users/jonom","html_url":"https://github.com/jonom","followers_url":"https://api.github.com/users/jonom/followers","following_url":"https://api.github.com/users/jonom/following{/other_user}","gists_url":"https://api.github.com/users/jonom/gists{/gist_id}","starred_url":"https://api.github.com/users/jonom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonom/subscriptions","organizations_url":"https://api.github.com/users/jonom/orgs","repos_url":"https://api.github.com/users/jonom/repos","events_url":"https://api.github.com/users/jonom/events{/privacy}","received_events_url":"https://api.github.com/users/jonom/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T21:28:42Z","updated_at":"2015-06-09T21:28:42Z","body":"Thanks Loz! :+1: "}}