{"action":"created","comment":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/comments/139369719","pull_request_review_id":63290726,"id":139369719,"diff_hunk":"@@ -1454,6 +1455,24 @@ Delete Content Version\n     :401: If the user is not authorized to delete this version\n     :403: If the version is in state published\n \n+Delete Content Version Translation\n+``````````````````````\n+:Resource: /content/objects/<ID>/versions/<versionNo>/translations/<language_code>\n+:Method: DELETE\n+:Description: The translation is removed from a draft","path":"doc/specifications/rest/REST-API-V2.rst","position":16,"original_position":16,"commit_id":"1897d08840791241501af6f104f703704f376ec6","original_commit_id":"1897d08840791241501af6f104f703704f376ec6","user":{"login":"alongosz","id":7099219,"avatar_url":"https://avatars1.githubusercontent.com/u/7099219?v=4","gravatar_id":"","url":"https://api.github.com/users/alongosz","html_url":"https://github.com/alongosz","followers_url":"https://api.github.com/users/alongosz/followers","following_url":"https://api.github.com/users/alongosz/following{/other_user}","gists_url":"https://api.github.com/users/alongosz/gists{/gist_id}","starred_url":"https://api.github.com/users/alongosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alongosz/subscriptions","organizations_url":"https://api.github.com/users/alongosz/orgs","repos_url":"https://api.github.com/users/alongosz/repos","events_url":"https://api.github.com/users/alongosz/events{/privacy}","received_events_url":"https://api.github.com/users/alongosz/received_events","type":"User","site_admin":false},"body":"> according to https://ezsystems.app.box.com/s/d4jsidn3m0zzj39m9aei24357ajaeqfu this needs to be possible on the published version as well\r\n\r\nYou're right, it's just a `remove` link in the spec, without any intermediate draft view.\r\n\r\nI'll change it, so the REST endpoint will:\r\n1. Check if Version is published (as box spec shows this only for published Versions).\r\n2. Create Draft.\r\n3. Remove language from this Draft.\r\n4. Publish Draft w/o removed language.\r\n\r\n@dpobel does this work for you?\r\n","created_at":"2017-09-18T09:08:47Z","updated_at":"2017-09-18T09:08:47Z","html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/2086#discussion_r139369719","pull_request_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/2086","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/comments/139369719"},"html":{"href":"https://github.com/ezsystems/ezpublish-kernel/pull/2086#discussion_r139369719"},"pull_request":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/2086"}},"in_reply_to_id":139358711},"pull_request":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/2086","id":141320755,"html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/2086","diff_url":"https://github.com/ezsystems/ezpublish-kernel/pull/2086.diff","patch_url":"https://github.com/ezsystems/ezpublish-kernel/pull/2086.patch","issue_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/2086","number":2086,"state":"open","locked":false,"title":"[WIP] EZP-27864: As a REST Consumer I want to remove translation from a single Version","user":{"login":"alongosz","id":7099219,"avatar_url":"https://avatars1.githubusercontent.com/u/7099219?v=4","gravatar_id":"","url":"https://api.github.com/users/alongosz","html_url":"https://github.com/alongosz","followers_url":"https://api.github.com/users/alongosz/followers","following_url":"https://api.github.com/users/alongosz/following{/other_user}","gists_url":"https://api.github.com/users/alongosz/gists{/gist_id}","starred_url":"https://api.github.com/users/alongosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alongosz/subscriptions","organizations_url":"https://api.github.com/users/alongosz/orgs","repos_url":"https://api.github.com/users/alongosz/repos","events_url":"https://api.github.com/users/alongosz/events{/privacy}","received_events_url":"https://api.github.com/users/alongosz/received_events","type":"User","site_admin":false},"body":"# Implements [EZP-27864](https://jira.ez.no/browse/EZP-27864)\r\n|  |  |\r\n| --- | --- |\r\n| Status:  | **Work in progress**  |\r\n| Target branch: | [ezp-27508-papi-delete-transl-from-ver](https://github.com/ezsystems/ezpublish-kernel/tree/ezp-27508-papi-delete-transl-from-ver) |\r\n| Related PR:    | #2081 |\r\n| REST endpoint: | `/content/objects/<ID>/versions/<no>/translations/<language_code>` |\r\n| HTTP method: | `DELETE` |\r\n\r\nThis PR implements REST endpoint which allows deleting translation from a Content Object Version in the **DRAFT** state.\r\n\r\nTo simplify using this feature, an extra (optional) header `X-Set-Main-Translation` can be sent to change main Translation (`mainLanguageCode`) before removing Translation. This is useful when deleted Translation is currently the main Translation of a Content Object.\r\n\r\nThe other idea to solve updating main Translation was suggested [here](https://jira.ez.no/browse/EZP-25684?focusedCommentId=215847&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-215847) and is as follows:\r\n> I think we should just define a rule (and document it for the API), what makes sense to me is the chronological order. Take the oldest language introduced in the content item.\r\n\r\nSo this needs to be discussed (I think doing it per Consumer request is cleaner and more flexible, but don't mind handling it automatically via REST endpoint as initially suggested).\r\n\r\n**Note**: Temporarily, to speed up development, PR targets branch containing PHP API implementation of this method which is needed by REST endpoint.\r\n\r\nTODO:\r\n- [x] Create REST endpoint specification\r\n- [ ] Discuss if the spec meets current capabilities of UI\r\n- [ ] Create functional test (probably not fully possible due to lack of Languages REST endpoints)","created_at":"2017-09-15T14:12:47Z","updated_at":"2017-09-18T09:08:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe054268d5dc409ab5b13a23c104fdb65409c8e9","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/2086/commits","review_comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/2086/comments","review_comment_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/2086/comments","statuses_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/statuses/1897d08840791241501af6f104f703704f376ec6","head":{"label":"ezsystems:ezp-27864-rest-delete-transl-from-ver","ref":"ezp-27864-rest-delete-transl-from-ver","sha":"1897d08840791241501af6f104f703704f376ec6","user":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars1.githubusercontent.com/u/295311?v=4","gravatar_id":"","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"repo":{"id":1663890,"name":"ezpublish-kernel","full_name":"ezsystems/ezpublish-kernel","owner":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars1.githubusercontent.com/u/295311?v=4","gravatar_id":"","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ezsystems/ezpublish-kernel","description":"Kernel (Repository, MVC layer, REST) for eZ Platform","fork":false,"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel","forks_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/forks","keys_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/teams","hooks_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/hooks","issue_events_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/events{/number}","events_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/events","assignees_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/assignees{/user}","branches_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/branches{/branch}","tags_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/tags","blobs_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/refs{/sha}","trees_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/statuses/{sha}","languages_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/languages","stargazers_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/stargazers","contributors_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/contributors","subscribers_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/subscribers","subscription_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/subscription","commits_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/commits{/sha}","git_commits_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/commits{/sha}","comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/comments{/number}","issue_comment_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/comments{/number}","contents_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/contents/{+path}","compare_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/merges","archive_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/downloads","issues_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues{/number}","pulls_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls{/number}","milestones_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/milestones{/number}","notifications_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/labels{/name}","releases_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/releases{/id}","deployments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/deployments","created_at":"2011-04-26T08:54:24Z","updated_at":"2017-09-15T12:07:43Z","pushed_at":"2017-09-18T08:35:57Z","git_url":"git://github.com/ezsystems/ezpublish-kernel.git","ssh_url":"git@github.com:ezsystems/ezpublish-kernel.git","clone_url":"https://github.com/ezsystems/ezpublish-kernel.git","svn_url":"https://github.com/ezsystems/ezpublish-kernel","homepage":"http://ezplatform.com/","size":49212,"stargazers_count":129,"watchers_count":129,"language":"PHP","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":188,"mirror_url":null,"open_issues_count":82,"forks":188,"open_issues":82,"watchers":129,"default_branch":"master"}},"base":{"label":"ezsystems:ezp-27508-papi-delete-transl-from-ver","ref":"ezp-27508-papi-delete-transl-from-ver","sha":"11a3cccb4a86c05513cc4d294c5a46154b518a4f","user":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars1.githubusercontent.com/u/295311?v=4","gravatar_id":"","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"repo":{"id":1663890,"name":"ezpublish-kernel","full_name":"ezsystems/ezpublish-kernel","owner":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars1.githubusercontent.com/u/295311?v=4","gravatar_id":"","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ezsystems/ezpublish-kernel","description":"Kernel (Repository, MVC layer, REST) for eZ Platform","fork":false,"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel","forks_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/forks","keys_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/teams","hooks_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/hooks","issue_events_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/events{/number}","events_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/events","assignees_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/assignees{/user}","branches_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/branches{/branch}","tags_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/tags","blobs_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/refs{/sha}","trees_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/statuses/{sha}","languages_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/languages","stargazers_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/stargazers","contributors_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/contributors","subscribers_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/subscribers","subscription_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/subscription","commits_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/commits{/sha}","git_commits_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/commits{/sha}","comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/comments{/number}","issue_comment_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/comments{/number}","contents_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/contents/{+path}","compare_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/merges","archive_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/downloads","issues_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues{/number}","pulls_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls{/number}","milestones_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/milestones{/number}","notifications_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/labels{/name}","releases_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/releases{/id}","deployments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/deployments","created_at":"2011-04-26T08:54:24Z","updated_at":"2017-09-15T12:07:43Z","pushed_at":"2017-09-18T08:35:57Z","git_url":"git://github.com/ezsystems/ezpublish-kernel.git","ssh_url":"git@github.com:ezsystems/ezpublish-kernel.git","clone_url":"https://github.com/ezsystems/ezpublish-kernel.git","svn_url":"https://github.com/ezsystems/ezpublish-kernel","homepage":"http://ezplatform.com/","size":49212,"stargazers_count":129,"watchers_count":129,"language":"PHP","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":188,"mirror_url":null,"open_issues_count":82,"forks":188,"open_issues":82,"watchers":129,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/2086"},"html":{"href":"https://github.com/ezsystems/ezpublish-kernel/pull/2086"},"issue":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/2086"},"comments":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/2086/comments"},"review_comments":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/2086/comments"},"review_comment":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/2086/commits"},"statuses":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/statuses/1897d08840791241501af6f104f703704f376ec6"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"alongosz"}}