{"action":"created","issue":{"url":"https://api.github.com/repos/processwire/processwire-issues/issues/572","repository_url":"https://api.github.com/repos/processwire/processwire-issues","labels_url":"https://api.github.com/repos/processwire/processwire-issues/issues/572/labels{/name}","comments_url":"https://api.github.com/repos/processwire/processwire-issues/issues/572/comments","events_url":"https://api.github.com/repos/processwire/processwire-issues/issues/572/events","html_url":"https://github.com/processwire/processwire-issues/issues/572","id":317315183,"number":572,"title":"New circular reference issue with page reference field","user":{"login":"adrianbj","id":871211,"avatar_url":"https://avatars0.githubusercontent.com/u/871211?v=4","gravatar_id":"","url":"https://api.github.com/users/adrianbj","html_url":"https://github.com/adrianbj","followers_url":"https://api.github.com/users/adrianbj/followers","following_url":"https://api.github.com/users/adrianbj/following{/other_user}","gists_url":"https://api.github.com/users/adrianbj/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianbj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianbj/subscriptions","organizations_url":"https://api.github.com/users/adrianbj/orgs","repos_url":"https://api.github.com/users/adrianbj/repos","events_url":"https://api.github.com/users/adrianbj/events{/privacy}","received_events_url":"https://api.github.com/users/adrianbj/received_events","type":"User","site_admin":false},"labels":[{"id":450125503,"url":"https://api.github.com/repos/processwire/processwire-issues/labels/status:%20discussion","name":"status: discussion","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-04-24T17:03:29Z","updated_at":"2018-04-27T15:14:46Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nIf you want your bug report\r\n* to be more difficult to process and understand\r\n* to have many unnecessary follow-up questions\r\n* to take longer to fix then necessary\r\ndon’t use this issue template.\r\n\r\nIf you want your bug report \r\n* to be concise and easy to understand\r\n* to not have any (or very few) follow-up questions\r\n* to take faster to fix\r\nuse this issue template. Thank you.\r\n-->\r\n\r\n### Short description of the issue\r\n\r\nFirstly, just to clarify, this is different to the old: https://github.com/ryancramerdesign/ProcessWire/issues/663\r\n\r\nI two two page reference fields on the user template: `subscriber` and `tester`\r\n\r\nUser 1 selects User 2 as tester\r\nUser 2 selects User 1 as subscriber\r\nUser 3 selects User 1 as subscriber\r\n\r\nThis results in a circular reference and out of memory errors because of the `resetTrackChanges()` method. \r\n\r\n### Expected behavior\r\n\r\nI should be able to reference a page from another page with one page reference field and reference the original one via a different page reference field.\r\n\r\n### Actual behavior\r\n\r\nOut of memory error due to circular reference.\r\n\r\n### Optional: Suggestion for a possible fix\r\n\r\nI think the approach is to store a PageArray of already process pages from `$value` and check the next `$value` against this to ensure it's only processed once.\r\n\r\n### Steps to reproduce the issue\r\n<!-- Provide an unambiguous set of steps to reproduce the issue. -->\r\n\r\n1. Create two page reference fields on the same template\r\n2. Select Page 1 from Page 2 for one of the fields\r\n3. Select Page 2 from Page 1 for the other field\r\n4. Try to edit the page in the admin or call it via the API\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/processwire/processwire-issues/issues/comments/385001113","html_url":"https://github.com/processwire/processwire-issues/issues/572#issuecomment-385001113","issue_url":"https://api.github.com/repos/processwire/processwire-issues/issues/572","id":385001113,"user":{"login":"adrianbj","id":871211,"avatar_url":"https://avatars0.githubusercontent.com/u/871211?v=4","gravatar_id":"","url":"https://api.github.com/users/adrianbj","html_url":"https://github.com/adrianbj","followers_url":"https://api.github.com/users/adrianbj/followers","following_url":"https://api.github.com/users/adrianbj/following{/other_user}","gists_url":"https://api.github.com/users/adrianbj/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianbj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianbj/subscriptions","organizations_url":"https://api.github.com/users/adrianbj/orgs","repos_url":"https://api.github.com/users/adrianbj/repos","events_url":"https://api.github.com/users/adrianbj/events{/privacy}","received_events_url":"https://api.github.com/users/adrianbj/received_events","type":"User","site_admin":false},"created_at":"2018-04-27T15:14:46Z","updated_at":"2018-04-27T15:14:46Z","author_association":"NONE","body":"@ryancramerdesign - I can confirm that your version with the timestamp also works, so if you think it's better, then I am happy with it at the moment - it seems to make logical sense. I'll monitor things and let you know if I find any issues.\r\n"}}
{"actor":{"display_login":"adrianbj"}}