{"action":"created","comment":{"url":"https://api.github.com/repos/forkcms/forkcms/pulls/comments/171316141","pull_request_review_id":100146105,"id":171316141,"diff_hunk":"@@ -235,21 +258,28 @@ public static function createFromMovieUrl(\n     public static function fromDataTransferObject(MediaItemDataTransferObject $mediaItemDataTransferObject): ?MediaItem\n     {\n         if (!$mediaItemDataTransferObject->hasExistingMediaItem()) {\n-            throw new \\BadFunctionCallException('This method can not be used to create a new media item');\n+            throw new BadFunctionCallException('This method can not be used to create a new media item');\n         }\n \n         $mediaItem = $mediaItemDataTransferObject->getMediaItemEntity();\n \n-        $mediaItem->title = $mediaItemDataTransferObject->title;\n         $mediaItem->folder = $mediaItemDataTransferObject->folder;\n         $mediaItem->userId = $mediaItemDataTransferObject->userId;\n         $mediaItem->url = $mediaItemDataTransferObject->url;\n \n+        foreach ($mediaItemDataTransferObject->translations as $mediaItemTranslationDataTransferObject) {\n+            $mediaItemTranslationDataTransferObject->setMediaItem($mediaItem);\n+\n+            $mediaItem->addTranslation(MediaItemTranslation::fromDataTransferObject($mediaItemTranslationDataTransferObject));\n+        }\n+\n         return $mediaItem;\n     }\n \n     public function jsonSerialize(): array\n     {\n+        $locale = BackendLocale::workingLocale();","path":"src/Backend/Modules/MediaLibrary/Domain/MediaItem/MediaItem.php","position":113,"original_position":113,"commit_id":"edb1ed6f5d4c22f74bd3bb49cf92280c1615c09c","original_commit_id":"edb1ed6f5d4c22f74bd3bb49cf92280c1615c09c","user":{"login":"carakas","id":3634654,"avatar_url":"https://avatars3.githubusercontent.com/u/3634654?v=4","gravatar_id":"","url":"https://api.github.com/users/carakas","html_url":"https://github.com/carakas","followers_url":"https://api.github.com/users/carakas/followers","following_url":"https://api.github.com/users/carakas/following{/other_user}","gists_url":"https://api.github.com/users/carakas/gists{/gist_id}","starred_url":"https://api.github.com/users/carakas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carakas/subscriptions","organizations_url":"https://api.github.com/users/carakas/orgs","repos_url":"https://api.github.com/users/carakas/repos","events_url":"https://api.github.com/users/carakas/events{/privacy}","received_events_url":"https://api.github.com/users/carakas/received_events","type":"User","site_admin":false},"body":"not a fan of this, I think a method to set the active language is better with a fallback like this for instance, but now if you would try to use this in the frontend it would fail","created_at":"2018-02-28T17:06:45Z","updated_at":"2018-02-28T17:07:47Z","html_url":"https://github.com/forkcms/forkcms/pull/2485#discussion_r171316141","pull_request_url":"https://api.github.com/repos/forkcms/forkcms/pulls/2485","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/forkcms/forkcms/pulls/comments/171316141"},"html":{"href":"https://github.com/forkcms/forkcms/pull/2485#discussion_r171316141"},"pull_request":{"href":"https://api.github.com/repos/forkcms/forkcms/pulls/2485"}}},"pull_request":{"url":"https://api.github.com/repos/forkcms/forkcms/pulls/2485","id":170460370,"html_url":"https://github.com/forkcms/forkcms/pull/2485","diff_url":"https://github.com/forkcms/forkcms/pull/2485.diff","patch_url":"https://github.com/forkcms/forkcms/pull/2485.patch","issue_url":"https://api.github.com/repos/forkcms/forkcms/issues/2485","number":2485,"state":"open","locked":false,"title":"Add MediaItemTranslation and make it editable","user":{"login":"jeroendesloovere","id":588616,"avatar_url":"https://avatars1.githubusercontent.com/u/588616?v=4","gravatar_id":"","url":"https://api.github.com/users/jeroendesloovere","html_url":"https://github.com/jeroendesloovere","followers_url":"https://api.github.com/users/jeroendesloovere/followers","following_url":"https://api.github.com/users/jeroendesloovere/following{/other_user}","gists_url":"https://api.github.com/users/jeroendesloovere/gists{/gist_id}","starred_url":"https://api.github.com/users/jeroendesloovere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeroendesloovere/subscriptions","organizations_url":"https://api.github.com/users/jeroendesloovere/orgs","repos_url":"https://api.github.com/users/jeroendesloovere/repos","events_url":"https://api.github.com/users/jeroendesloovere/events{/privacy}","received_events_url":"https://api.github.com/users/jeroendesloovere/received_events","type":"User","site_admin":false},"body":"## Type\r\n<!-- Remove the types that don't apply -->\r\n<!-- If you discover any security related issues, please email core@fork-cms.com instead of using the issue tracker. -->\r\n\r\n- Feature\r\n\r\n## Resolves the following issues\r\n<!-- List the hashes of the issues that this pull request resolves if their are issues for it. -->\r\n<!-- Use the following format: fixes #[issue_number] -->\r\n\r\nFixes #2469 \r\nThis PR handles the Backend part.\r\n\r\n## Pull request description\r\n<!-- Describe what your pull request will fix / add / … -->\r\n\r\nMediaItem has now more descriptive fields and they can be filled in for every language:\r\n* Title\r\n* Caption\r\n* CaptionLink\r\n* Alt text\r\n* Description\r\n![schermafbeelding 2018-02-21 om 13 22 03](https://user-images.githubusercontent.com/588616/36480756-c71b0f78-170d-11e8-8c6d-4d9d2c08512d.png)\r\n\r\n![schermafbeelding 2018-02-21 om 13 43 48](https://user-images.githubusercontent.com/588616/36480762-c994f2e6-170d-11e8-9603-8193220af8df.png)\r\n","created_at":"2018-02-21T12:48:15Z","updated_at":"2018-02-28T17:07:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4843ad3ba5cd9ecf84f20cfdb3f6733269b35fd8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":31503540,"url":"https://api.github.com/repos/forkcms/forkcms/labels/Feature","name":"Feature","color":"28E531","default":false},{"id":567653212,"url":"https://api.github.com/repos/forkcms/forkcms/labels/Media%20Library","name":"Media Library","color":"dddddd","default":false}],"milestone":{"url":"https://api.github.com/repos/forkcms/forkcms/milestones/37","html_url":"https://github.com/forkcms/forkcms/milestone/37","labels_url":"https://api.github.com/repos/forkcms/forkcms/milestones/37/labels","id":2414212,"number":37,"title":"6.0.0","description":null,"creator":{"login":"StijnVrolijk","id":442529,"avatar_url":"https://avatars1.githubusercontent.com/u/442529?v=4","gravatar_id":"","url":"https://api.github.com/users/StijnVrolijk","html_url":"https://github.com/StijnVrolijk","followers_url":"https://api.github.com/users/StijnVrolijk/followers","following_url":"https://api.github.com/users/StijnVrolijk/following{/other_user}","gists_url":"https://api.github.com/users/StijnVrolijk/gists{/gist_id}","starred_url":"https://api.github.com/users/StijnVrolijk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StijnVrolijk/subscriptions","organizations_url":"https://api.github.com/users/StijnVrolijk/orgs","repos_url":"https://api.github.com/users/StijnVrolijk/repos","events_url":"https://api.github.com/users/StijnVrolijk/events{/privacy}","received_events_url":"https://api.github.com/users/StijnVrolijk/received_events","type":"User","site_admin":false},"open_issues":24,"closed_issues":5,"state":"open","created_at":"2017-03-27T16:28:16Z","updated_at":"2018-02-21T12:48:15Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/forkcms/forkcms/pulls/2485/commits","review_comments_url":"https://api.github.com/repos/forkcms/forkcms/pulls/2485/comments","review_comment_url":"https://api.github.com/repos/forkcms/forkcms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/forkcms/forkcms/issues/2485/comments","statuses_url":"https://api.github.com/repos/forkcms/forkcms/statuses/edb1ed6f5d4c22f74bd3bb49cf92280c1615c09c","head":{"label":"jeroendesloovere:media-item-translation","ref":"media-item-translation","sha":"edb1ed6f5d4c22f74bd3bb49cf92280c1615c09c","user":{"login":"jeroendesloovere","id":588616,"avatar_url":"https://avatars1.githubusercontent.com/u/588616?v=4","gravatar_id":"","url":"https://api.github.com/users/jeroendesloovere","html_url":"https://github.com/jeroendesloovere","followers_url":"https://api.github.com/users/jeroendesloovere/followers","following_url":"https://api.github.com/users/jeroendesloovere/following{/other_user}","gists_url":"https://api.github.com/users/jeroendesloovere/gists{/gist_id}","starred_url":"https://api.github.com/users/jeroendesloovere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeroendesloovere/subscriptions","organizations_url":"https://api.github.com/users/jeroendesloovere/orgs","repos_url":"https://api.github.com/users/jeroendesloovere/repos","events_url":"https://api.github.com/users/jeroendesloovere/events{/privacy}","received_events_url":"https://api.github.com/users/jeroendesloovere/received_events","type":"User","site_admin":false},"repo":{"id":18802379,"name":"forkcms","full_name":"jeroendesloovere/forkcms","owner":{"login":"jeroendesloovere","id":588616,"avatar_url":"https://avatars1.githubusercontent.com/u/588616?v=4","gravatar_id":"","url":"https://api.github.com/users/jeroendesloovere","html_url":"https://github.com/jeroendesloovere","followers_url":"https://api.github.com/users/jeroendesloovere/followers","following_url":"https://api.github.com/users/jeroendesloovere/following{/other_user}","gists_url":"https://api.github.com/users/jeroendesloovere/gists{/gist_id}","starred_url":"https://api.github.com/users/jeroendesloovere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeroendesloovere/subscriptions","organizations_url":"https://api.github.com/users/jeroendesloovere/orgs","repos_url":"https://api.github.com/users/jeroendesloovere/repos","events_url":"https://api.github.com/users/jeroendesloovere/events{/privacy}","received_events_url":"https://api.github.com/users/jeroendesloovere/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jeroendesloovere/forkcms","description":"Fork is an open source CMS.","fork":true,"url":"https://api.github.com/repos/jeroendesloovere/forkcms","forks_url":"https://api.github.com/repos/jeroendesloovere/forkcms/forks","keys_url":"https://api.github.com/repos/jeroendesloovere/forkcms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jeroendesloovere/forkcms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jeroendesloovere/forkcms/teams","hooks_url":"https://api.github.com/repos/jeroendesloovere/forkcms/hooks","issue_events_url":"https://api.github.com/repos/jeroendesloovere/forkcms/issues/events{/number}","events_url":"https://api.github.com/repos/jeroendesloovere/forkcms/events","assignees_url":"https://api.github.com/repos/jeroendesloovere/forkcms/assignees{/user}","branches_url":"https://api.github.com/repos/jeroendesloovere/forkcms/branches{/branch}","tags_url":"https://api.github.com/repos/jeroendesloovere/forkcms/tags","blobs_url":"https://api.github.com/repos/jeroendesloovere/forkcms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jeroendesloovere/forkcms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jeroendesloovere/forkcms/git/refs{/sha}","trees_url":"https://api.github.com/repos/jeroendesloovere/forkcms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jeroendesloovere/forkcms/statuses/{sha}","languages_url":"https://api.github.com/repos/jeroendesloovere/forkcms/languages","stargazers_url":"https://api.github.com/repos/jeroendesloovere/forkcms/stargazers","contributors_url":"https://api.github.com/repos/jeroendesloovere/forkcms/contributors","subscribers_url":"https://api.github.com/repos/jeroendesloovere/forkcms/subscribers","subscription_url":"https://api.github.com/repos/jeroendesloovere/forkcms/subscription","commits_url":"https://api.github.com/repos/jeroendesloovere/forkcms/commits{/sha}","git_commits_url":"https://api.github.com/repos/jeroendesloovere/forkcms/git/commits{/sha}","comments_url":"https://api.github.com/repos/jeroendesloovere/forkcms/comments{/number}","issue_comment_url":"https://api.github.com/repos/jeroendesloovere/forkcms/issues/comments{/number}","contents_url":"https://api.github.com/repos/jeroendesloovere/forkcms/contents/{+path}","compare_url":"https://api.github.com/repos/jeroendesloovere/forkcms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jeroendesloovere/forkcms/merges","archive_url":"https://api.github.com/repos/jeroendesloovere/forkcms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jeroendesloovere/forkcms/downloads","issues_url":"https://api.github.com/repos/jeroendesloovere/forkcms/issues{/number}","pulls_url":"https://api.github.com/repos/jeroendesloovere/forkcms/pulls{/number}","milestones_url":"https://api.github.com/repos/jeroendesloovere/forkcms/milestones{/number}","notifications_url":"https://api.github.com/repos/jeroendesloovere/forkcms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jeroendesloovere/forkcms/labels{/name}","releases_url":"https://api.github.com/repos/jeroendesloovere/forkcms/releases{/id}","deployments_url":"https://api.github.com/repos/jeroendesloovere/forkcms/deployments","created_at":"2014-04-15T14:08:29Z","updated_at":"2016-10-24T08:33:48Z","pushed_at":"2018-02-27T10:39:13Z","git_url":"git://github.com/jeroendesloovere/forkcms.git","ssh_url":"git@github.com:jeroendesloovere/forkcms.git","clone_url":"https://github.com/jeroendesloovere/forkcms.git","svn_url":"https://github.com/jeroendesloovere/forkcms","homepage":"http://www.fork-cms.com","size":77298,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"forkcms:6.0.0-dev","ref":"6.0.0-dev","sha":"8664c8b6d871ef03f3163c6e5981914d1b321198","user":{"login":"forkcms","id":312505,"avatar_url":"https://avatars1.githubusercontent.com/u/312505?v=4","gravatar_id":"","url":"https://api.github.com/users/forkcms","html_url":"https://github.com/forkcms","followers_url":"https://api.github.com/users/forkcms/followers","following_url":"https://api.github.com/users/forkcms/following{/other_user}","gists_url":"https://api.github.com/users/forkcms/gists{/gist_id}","starred_url":"https://api.github.com/users/forkcms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forkcms/subscriptions","organizations_url":"https://api.github.com/users/forkcms/orgs","repos_url":"https://api.github.com/users/forkcms/repos","events_url":"https://api.github.com/users/forkcms/events{/privacy}","received_events_url":"https://api.github.com/users/forkcms/received_events","type":"Organization","site_admin":false},"repo":{"id":1138583,"name":"forkcms","full_name":"forkcms/forkcms","owner":{"login":"forkcms","id":312505,"avatar_url":"https://avatars1.githubusercontent.com/u/312505?v=4","gravatar_id":"","url":"https://api.github.com/users/forkcms","html_url":"https://github.com/forkcms","followers_url":"https://api.github.com/users/forkcms/followers","following_url":"https://api.github.com/users/forkcms/following{/other_user}","gists_url":"https://api.github.com/users/forkcms/gists{/gist_id}","starred_url":"https://api.github.com/users/forkcms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forkcms/subscriptions","organizations_url":"https://api.github.com/users/forkcms/orgs","repos_url":"https://api.github.com/users/forkcms/repos","events_url":"https://api.github.com/users/forkcms/events{/privacy}","received_events_url":"https://api.github.com/users/forkcms/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/forkcms/forkcms","description":"Fork is an easy to use open source CMS using Symfony Components.","fork":false,"url":"https://api.github.com/repos/forkcms/forkcms","forks_url":"https://api.github.com/repos/forkcms/forkcms/forks","keys_url":"https://api.github.com/repos/forkcms/forkcms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/forkcms/forkcms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/forkcms/forkcms/teams","hooks_url":"https://api.github.com/repos/forkcms/forkcms/hooks","issue_events_url":"https://api.github.com/repos/forkcms/forkcms/issues/events{/number}","events_url":"https://api.github.com/repos/forkcms/forkcms/events","assignees_url":"https://api.github.com/repos/forkcms/forkcms/assignees{/user}","branches_url":"https://api.github.com/repos/forkcms/forkcms/branches{/branch}","tags_url":"https://api.github.com/repos/forkcms/forkcms/tags","blobs_url":"https://api.github.com/repos/forkcms/forkcms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/forkcms/forkcms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/forkcms/forkcms/git/refs{/sha}","trees_url":"https://api.github.com/repos/forkcms/forkcms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/forkcms/forkcms/statuses/{sha}","languages_url":"https://api.github.com/repos/forkcms/forkcms/languages","stargazers_url":"https://api.github.com/repos/forkcms/forkcms/stargazers","contributors_url":"https://api.github.com/repos/forkcms/forkcms/contributors","subscribers_url":"https://api.github.com/repos/forkcms/forkcms/subscribers","subscription_url":"https://api.github.com/repos/forkcms/forkcms/subscription","commits_url":"https://api.github.com/repos/forkcms/forkcms/commits{/sha}","git_commits_url":"https://api.github.com/repos/forkcms/forkcms/git/commits{/sha}","comments_url":"https://api.github.com/repos/forkcms/forkcms/comments{/number}","issue_comment_url":"https://api.github.com/repos/forkcms/forkcms/issues/comments{/number}","contents_url":"https://api.github.com/repos/forkcms/forkcms/contents/{+path}","compare_url":"https://api.github.com/repos/forkcms/forkcms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/forkcms/forkcms/merges","archive_url":"https://api.github.com/repos/forkcms/forkcms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/forkcms/forkcms/downloads","issues_url":"https://api.github.com/repos/forkcms/forkcms/issues{/number}","pulls_url":"https://api.github.com/repos/forkcms/forkcms/pulls{/number}","milestones_url":"https://api.github.com/repos/forkcms/forkcms/milestones{/number}","notifications_url":"https://api.github.com/repos/forkcms/forkcms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/forkcms/forkcms/labels{/name}","releases_url":"https://api.github.com/repos/forkcms/forkcms/releases{/id}","deployments_url":"https://api.github.com/repos/forkcms/forkcms/deployments","created_at":"2010-12-04T18:06:15Z","updated_at":"2018-02-26T06:51:56Z","pushed_at":"2018-02-28T16:57:34Z","git_url":"git://github.com/forkcms/forkcms.git","ssh_url":"git@github.com:forkcms/forkcms.git","clone_url":"https://github.com/forkcms/forkcms.git","svn_url":"https://github.com/forkcms/forkcms","homepage":"http://www.fork-cms.com","size":74849,"stargazers_count":1008,"watchers_count":1008,"language":"PHP","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":262,"mirror_url":null,"archived":false,"open_issues_count":74,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":262,"open_issues":74,"watchers":1008,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/forkcms/forkcms/pulls/2485"},"html":{"href":"https://github.com/forkcms/forkcms/pull/2485"},"issue":{"href":"https://api.github.com/repos/forkcms/forkcms/issues/2485"},"comments":{"href":"https://api.github.com/repos/forkcms/forkcms/issues/2485/comments"},"review_comments":{"href":"https://api.github.com/repos/forkcms/forkcms/pulls/2485/comments"},"review_comment":{"href":"https://api.github.com/repos/forkcms/forkcms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/forkcms/forkcms/pulls/2485/commits"},"statuses":{"href":"https://api.github.com/repos/forkcms/forkcms/statuses/edb1ed6f5d4c22f74bd3bb49cf92280c1615c09c"}},"author_association":"OWNER"}}
{"actor":{"display_login":"carakas"}}