{"action":"created","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-versioned/issues/25","repository_url":"https://api.github.com/repos/silverstripe/silverstripe-versioned","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-versioned/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-versioned/issues/25/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-versioned/issues/25/events","html_url":"https://github.com/silverstripe/silverstripe-versioned/issues/25","id":241115008,"number":25,"title":"Don't unpublish owner when unpublishing owned object","user":{"login":"chillu","id":111025,"avatar_url":"https://avatars0.githubusercontent.com/u/111025?v=3","gravatar_id":"","url":"https://api.github.com/users/chillu","html_url":"https://github.com/chillu","followers_url":"https://api.github.com/users/chillu/followers","following_url":"https://api.github.com/users/chillu/following{/other_user}","gists_url":"https://api.github.com/users/chillu/gists{/gist_id}","starred_url":"https://api.github.com/users/chillu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chillu/subscriptions","organizations_url":"https://api.github.com/users/chillu/orgs","repos_url":"https://api.github.com/users/chillu/repos","events_url":"https://api.github.com/users/chillu/events{/privacy}","received_events_url":"https://api.github.com/users/chillu/received_events","type":"User","site_admin":false},"labels":[{"id":587719267,"url":"https://api.github.com/repos/silverstripe/silverstripe-versioned/labels/affects/v4","name":"affects/v4","color":"5319e7","default":false},{"id":587719354,"url":"https://api.github.com/repos/silverstripe/silverstripe-versioned/labels/change/patch","name":"change/patch","color":"fef2c0","default":false},{"id":587719392,"url":"https://api.github.com/repos/silverstripe/silverstripe-versioned/labels/effort/medium","name":"effort/medium","color":"fef2c0","default":false},{"id":587719473,"url":"https://api.github.com/repos/silverstripe/silverstripe-versioned/labels/impact/high","name":"impact/high","color":"eb6420","default":false},{"id":565297317,"url":"https://api.github.com/repos/silverstripe/silverstripe-versioned/labels/type/enhancement","name":"type/enhancement","color":"0e8a16","default":false},{"id":587719580,"url":"https://api.github.com/repos/silverstripe/silverstripe-versioned/labels/type/UX","name":"type/UX","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/silverstripe/silverstripe-versioned/milestones/2","html_url":"https://github.com/silverstripe/silverstripe-versioned/milestone/2","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-versioned/milestones/2/labels","id":2622729,"number":2,"title":"4.0.0-beta2","description":"","creator":{"login":"chillu","id":111025,"avatar_url":"https://avatars0.githubusercontent.com/u/111025?v=3","gravatar_id":"","url":"https://api.github.com/users/chillu","html_url":"https://github.com/chillu","followers_url":"https://api.github.com/users/chillu/followers","following_url":"https://api.github.com/users/chillu/following{/other_user}","gists_url":"https://api.github.com/users/chillu/gists{/gist_id}","starred_url":"https://api.github.com/users/chillu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chillu/subscriptions","organizations_url":"https://api.github.com/users/chillu/orgs","repos_url":"https://api.github.com/users/chillu/repos","events_url":"https://api.github.com/users/chillu/events{/privacy}","received_events_url":"https://api.github.com/users/chillu/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":0,"state":"open","created_at":"2017-07-05T10:34:22Z","updated_at":"2017-07-06T23:51:12Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2017-07-06T23:28:05Z","updated_at":"2017-07-06T23:52:18Z","closed_at":null,"body":"## Overview\r\n\r\nAt the moment, `Versioned->onAfterUnpublish()` will trigger a cascading unpublish on direct and indirect owners. That's consistent behaviour from a technical perspective, since the owner record now contains unpublished records and can't display the same way any more. In practice, that's not really reflecting the authors intentions. Most templates can deal with missing records:\r\n\r\n * If you list a has_many relationship, it'll simply omit the now unpublished owned object\r\n * If you show a has_one relationship, it'll skip this part of the template\r\n * If you have a required has_one relationship (template fails without it), you should code your template defensively (don't show that portion of the template). If it's absolutely required for the template to function, then you should opt in to cascading unpublish\r\n\r\nAn example: `Page has_many PromoItem` and `PromoItem has_many Image`, with ownership. If you unpublish that image, it'll unpublish the `PromoItem` *and* the `Page` containing this `PromoItem`.\r\n\r\n## Acceptance Criteria\r\n\r\n * A developer understands the implications of allowing versioned controls on owned records (e.g. through ModelAdmin, or opting into VersionedGridFieldEditForm elsewhere)\r\n * `Versioned->onAfterUnpublish` does not cascade by default\r\n * A developer can opt in to cascading unpublish on a per-relationship level without writing custom `onAfterUnpublish` hooks\r\n\r\n## Notes\r\n\r\n * I'm proposing to [make VersionedGridFieldEditForm opt-in](https://github.com/silverstripe/silverstripe-versioned/issues/21)\r\n\r\n/cc @pitchandtone @stevie-mayhew "},"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-versioned/issues/comments/313549999","html_url":"https://github.com/silverstripe/silverstripe-versioned/issues/25#issuecomment-313549999","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-versioned/issues/25","id":313549999,"user":{"login":"chillu","id":111025,"avatar_url":"https://avatars0.githubusercontent.com/u/111025?v=3","gravatar_id":"","url":"https://api.github.com/users/chillu","html_url":"https://github.com/chillu","followers_url":"https://api.github.com/users/chillu/followers","following_url":"https://api.github.com/users/chillu/following{/other_user}","gists_url":"https://api.github.com/users/chillu/gists{/gist_id}","starred_url":"https://api.github.com/users/chillu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chillu/subscriptions","organizations_url":"https://api.github.com/users/chillu/orgs","repos_url":"https://api.github.com/users/chillu/repos","events_url":"https://api.github.com/users/chillu/events{/privacy}","received_events_url":"https://api.github.com/users/chillu/received_events","type":"User","site_admin":false},"created_at":"2017-07-06T23:52:18Z","updated_at":"2017-07-06T23:52:18Z","body":"> I suggest at the very least, implementing a pre-unpublish notice in the files area that protects users in place of the auto-unpublish recursion.\r\n\r\nI've created https://github.com/silverstripe/silverstripe-versioned/issues/26 for this."}}
{"actor":{"display_login":"chillu"}}