{"action":"created","comment":{"url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/comments/221977118","pull_request_review_id":160754256,"id":221977118,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTk3NzExOA==","diff_hunk":"@@ -123,47 +122,12 @@ protected function getReferenceDataCollection(AttributeInterface $attribute, arr\n         $repository = $this->repositoryResolver->resolve($attribute->getReferenceDataName());\n \n         foreach ($referenceDataCodes as $referenceDataCode) {\n-            $referenceData = $this->getReferenceData($attribute, $repository, $referenceDataCode);\n-            if (!in_array($referenceData, $collection, true)) {\n+            $referenceData = $repository->findOneBy(['code' => $referenceDataCode]);\n+            if (!in_array($referenceData, $collection, true) && null !== $referenceData) {","path":"src/Pim/Component/ReferenceData/Factory/Value/ReferenceDataCollectionValueFactory.php","position":23,"original_position":23,"commit_id":"36d9bc6f2159bb830b29b43531cc6d9d294b839c","original_commit_id":"36d9bc6f2159bb830b29b43531cc6d9d294b839c","user":{"login":"BitOne","id":2151567,"node_id":"MDQ6VXNlcjIxNTE1Njc=","avatar_url":"https://avatars3.githubusercontent.com/u/2151567?v=4","gravatar_id":"","url":"https://api.github.com/users/BitOne","html_url":"https://github.com/BitOne","followers_url":"https://api.github.com/users/BitOne/followers","following_url":"https://api.github.com/users/BitOne/following{/other_user}","gists_url":"https://api.github.com/users/BitOne/gists{/gist_id}","starred_url":"https://api.github.com/users/BitOne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BitOne/subscriptions","organizations_url":"https://api.github.com/users/BitOne/orgs","repos_url":"https://api.github.com/users/BitOne/repos","events_url":"https://api.github.com/users/BitOne/events{/privacy}","received_events_url":"https://api.github.com/users/BitOne/received_events","type":"User","site_admin":false},"body":"I would have put the non null test before the in_array check. It seems more logical: no need to do any check if the referenceData does not exist anymore (and a little bit more efficient because no need to browse the array if the referenceData is null).","created_at":"2018-10-02T14:36:16Z","updated_at":"2018-10-02T14:36:21Z","html_url":"https://github.com/akeneo/pim-community-dev/pull/8918#discussion_r221977118","pull_request_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/8918","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/comments/221977118"},"html":{"href":"https://github.com/akeneo/pim-community-dev/pull/8918#discussion_r221977118"},"pull_request":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/8918"}}},"pull_request":{"url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/8918","id":219675452,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5Njc1NDUy","html_url":"https://github.com/akeneo/pim-community-dev/pull/8918","diff_url":"https://github.com/akeneo/pim-community-dev/pull/8918.diff","patch_url":"https://github.com/akeneo/pim-community-dev/pull/8918.patch","issue_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/8918","number":8918,"state":"open","locked":false,"title":"PIM-7664: an exception is not thrown anymore when the asset cannot be loaded","user":{"login":"rouliane","id":1978756,"node_id":"MDQ6VXNlcjE5Nzg3NTY=","avatar_url":"https://avatars0.githubusercontent.com/u/1978756?v=4","gravatar_id":"","url":"https://api.github.com/users/rouliane","html_url":"https://github.com/rouliane","followers_url":"https://api.github.com/users/rouliane/followers","following_url":"https://api.github.com/users/rouliane/following{/other_user}","gists_url":"https://api.github.com/users/rouliane/gists{/gist_id}","starred_url":"https://api.github.com/users/rouliane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rouliane/subscriptions","organizations_url":"https://api.github.com/users/rouliane/orgs","repos_url":"https://api.github.com/users/rouliane/repos","events_url":"https://api.github.com/users/rouliane/events{/privacy}","received_events_url":"https://api.github.com/users/rouliane/received_events","type":"User","site_admin":false},"body":"<!--- (<3 Thanks for taking the time to contribute! You're awesome! <3) --->\r\n\r\n<!--- (If you've never contributed to this repository before, please read https://github.com/akeneo/pim-community-dev/blob/master/.github/CONTRIBUTING.md) --->\r\n\r\n**Description (for Contributor and Core Developer)**\r\n\r\nEE PR : https://github.com/akeneo/pim-enterprise-dev/pull/4715\r\n\r\nThis PR add a fix to prevent an asset collection to be empty on the PEF when one or multiple assets of the collection are deleted. An exception was thrown in the ReferenceDataCollectionValueFactory that stopped the loading of ALL the assets of the attribute asset collection.\r\n\r\n<!--- (What does this Pull Request do? reference the related issue?) --->\r\n\r\n**Definition Of Done (for Core Developer only)**\r\n\r\n| Q                                 | A\r\n| --------------------------------- | ---\r\n| Added Specs                       | OK\r\n| Added legacy Behats               | -\r\n| Added acceptance tests            | -\r\n| Added integration tests           | -\r\n| Changelog updated                 | Todo\r\n| Review and 2 GTM                  | Todo\r\n| Micro Demo to the PO (Story only) | Todo\r\n| Migration script                  | -\r\n| Tech Doc                          | -\r\n\r\n`Todo`: Pending / Work in progress\r\n`OK`: Done / Validated\r\n`-`: Not needed\r\n","created_at":"2018-10-02T11:49:54Z","updated_at":"2018-10-02T14:36:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2907ce44de584c8f730d0275845215403e2219f6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":306739671,"node_id":"MDU6TGFiZWwzMDY3Mzk2NzE=","url":"https://api.github.com/repos/akeneo/pim-community-dev/labels/to%20review","name":"to review","color":"5319e7","default":false}],"milestone":{"url":"https://api.github.com/repos/akeneo/pim-community-dev/milestones/16","html_url":"https://github.com/akeneo/pim-community-dev/milestone/16","labels_url":"https://api.github.com/repos/akeneo/pim-community-dev/milestones/16/labels","id":3102303,"node_id":"MDk6TWlsZXN0b25lMzEwMjMwMw==","number":16,"title":"2.3.x","description":"","creator":{"login":"damien-carcel","id":5039018,"node_id":"MDQ6VXNlcjUwMzkwMTg=","avatar_url":"https://avatars3.githubusercontent.com/u/5039018?v=4","gravatar_id":"","url":"https://api.github.com/users/damien-carcel","html_url":"https://github.com/damien-carcel","followers_url":"https://api.github.com/users/damien-carcel/followers","following_url":"https://api.github.com/users/damien-carcel/following{/other_user}","gists_url":"https://api.github.com/users/damien-carcel/gists{/gist_id}","starred_url":"https://api.github.com/users/damien-carcel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damien-carcel/subscriptions","organizations_url":"https://api.github.com/users/damien-carcel/orgs","repos_url":"https://api.github.com/users/damien-carcel/repos","events_url":"https://api.github.com/users/damien-carcel/events{/privacy}","received_events_url":"https://api.github.com/users/damien-carcel/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":110,"state":"open","created_at":"2018-02-09T09:53:44Z","updated_at":"2018-10-02T12:31:09Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/8918/commits","review_comments_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/8918/comments","review_comment_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/comments{/number}","comments_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/8918/comments","statuses_url":"https://api.github.com/repos/akeneo/pim-community-dev/statuses/36d9bc6f2159bb830b29b43531cc6d9d294b839c","head":{"label":"akeneo:PIM-7664","ref":"PIM-7664","sha":"36d9bc6f2159bb830b29b43531cc6d9d294b839c","user":{"login":"akeneo","id":2510186,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MTAxODY=","avatar_url":"https://avatars0.githubusercontent.com/u/2510186?v=4","gravatar_id":"","url":"https://api.github.com/users/akeneo","html_url":"https://github.com/akeneo","followers_url":"https://api.github.com/users/akeneo/followers","following_url":"https://api.github.com/users/akeneo/following{/other_user}","gists_url":"https://api.github.com/users/akeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/akeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akeneo/subscriptions","organizations_url":"https://api.github.com/users/akeneo/orgs","repos_url":"https://api.github.com/users/akeneo/repos","events_url":"https://api.github.com/users/akeneo/events{/privacy}","received_events_url":"https://api.github.com/users/akeneo/received_events","type":"Organization","site_admin":false},"repo":{"id":5367323,"node_id":"MDEwOlJlcG9zaXRvcnk1MzY3MzIz","name":"pim-community-dev","full_name":"akeneo/pim-community-dev","private":false,"owner":{"login":"akeneo","id":2510186,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MTAxODY=","avatar_url":"https://avatars0.githubusercontent.com/u/2510186?v=4","gravatar_id":"","url":"https://api.github.com/users/akeneo","html_url":"https://github.com/akeneo","followers_url":"https://api.github.com/users/akeneo/followers","following_url":"https://api.github.com/users/akeneo/following{/other_user}","gists_url":"https://api.github.com/users/akeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/akeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akeneo/subscriptions","organizations_url":"https://api.github.com/users/akeneo/orgs","repos_url":"https://api.github.com/users/akeneo/repos","events_url":"https://api.github.com/users/akeneo/events{/privacy}","received_events_url":"https://api.github.com/users/akeneo/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/akeneo/pim-community-dev","description":"[Community Development Repository] The open source Product Information Management (PIM)","fork":false,"url":"https://api.github.com/repos/akeneo/pim-community-dev","forks_url":"https://api.github.com/repos/akeneo/pim-community-dev/forks","keys_url":"https://api.github.com/repos/akeneo/pim-community-dev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akeneo/pim-community-dev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akeneo/pim-community-dev/teams","hooks_url":"https://api.github.com/repos/akeneo/pim-community-dev/hooks","issue_events_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/events{/number}","events_url":"https://api.github.com/repos/akeneo/pim-community-dev/events","assignees_url":"https://api.github.com/repos/akeneo/pim-community-dev/assignees{/user}","branches_url":"https://api.github.com/repos/akeneo/pim-community-dev/branches{/branch}","tags_url":"https://api.github.com/repos/akeneo/pim-community-dev/tags","blobs_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/refs{/sha}","trees_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akeneo/pim-community-dev/statuses/{sha}","languages_url":"https://api.github.com/repos/akeneo/pim-community-dev/languages","stargazers_url":"https://api.github.com/repos/akeneo/pim-community-dev/stargazers","contributors_url":"https://api.github.com/repos/akeneo/pim-community-dev/contributors","subscribers_url":"https://api.github.com/repos/akeneo/pim-community-dev/subscribers","subscription_url":"https://api.github.com/repos/akeneo/pim-community-dev/subscription","commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/commits{/sha}","git_commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/commits{/sha}","comments_url":"https://api.github.com/repos/akeneo/pim-community-dev/comments{/number}","issue_comment_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/comments{/number}","contents_url":"https://api.github.com/repos/akeneo/pim-community-dev/contents/{+path}","compare_url":"https://api.github.com/repos/akeneo/pim-community-dev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akeneo/pim-community-dev/merges","archive_url":"https://api.github.com/repos/akeneo/pim-community-dev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akeneo/pim-community-dev/downloads","issues_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues{/number}","pulls_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls{/number}","milestones_url":"https://api.github.com/repos/akeneo/pim-community-dev/milestones{/number}","notifications_url":"https://api.github.com/repos/akeneo/pim-community-dev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akeneo/pim-community-dev/labels{/name}","releases_url":"https://api.github.com/repos/akeneo/pim-community-dev/releases{/id}","deployments_url":"https://api.github.com/repos/akeneo/pim-community-dev/deployments","created_at":"2012-08-10T09:27:26Z","updated_at":"2018-10-02T11:54:50Z","pushed_at":"2018-10-02T14:33:42Z","git_url":"git://github.com/akeneo/pim-community-dev.git","ssh_url":"git@github.com:akeneo/pim-community-dev.git","clone_url":"https://github.com/akeneo/pim-community-dev.git","svn_url":"https://github.com/akeneo/pim-community-dev","homepage":"http://www.akeneo.com","size":148666,"stargazers_count":546,"watchers_count":546,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":328,"mirror_url":null,"archived":false,"open_issues_count":274,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":328,"open_issues":274,"watchers":546,"default_branch":"master"}},"base":{"label":"akeneo:2.3","ref":"2.3","sha":"ebff507ffc41544e05546d60aee21e85102db4b5","user":{"login":"akeneo","id":2510186,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MTAxODY=","avatar_url":"https://avatars0.githubusercontent.com/u/2510186?v=4","gravatar_id":"","url":"https://api.github.com/users/akeneo","html_url":"https://github.com/akeneo","followers_url":"https://api.github.com/users/akeneo/followers","following_url":"https://api.github.com/users/akeneo/following{/other_user}","gists_url":"https://api.github.com/users/akeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/akeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akeneo/subscriptions","organizations_url":"https://api.github.com/users/akeneo/orgs","repos_url":"https://api.github.com/users/akeneo/repos","events_url":"https://api.github.com/users/akeneo/events{/privacy}","received_events_url":"https://api.github.com/users/akeneo/received_events","type":"Organization","site_admin":false},"repo":{"id":5367323,"node_id":"MDEwOlJlcG9zaXRvcnk1MzY3MzIz","name":"pim-community-dev","full_name":"akeneo/pim-community-dev","private":false,"owner":{"login":"akeneo","id":2510186,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MTAxODY=","avatar_url":"https://avatars0.githubusercontent.com/u/2510186?v=4","gravatar_id":"","url":"https://api.github.com/users/akeneo","html_url":"https://github.com/akeneo","followers_url":"https://api.github.com/users/akeneo/followers","following_url":"https://api.github.com/users/akeneo/following{/other_user}","gists_url":"https://api.github.com/users/akeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/akeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akeneo/subscriptions","organizations_url":"https://api.github.com/users/akeneo/orgs","repos_url":"https://api.github.com/users/akeneo/repos","events_url":"https://api.github.com/users/akeneo/events{/privacy}","received_events_url":"https://api.github.com/users/akeneo/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/akeneo/pim-community-dev","description":"[Community Development Repository] The open source Product Information Management (PIM)","fork":false,"url":"https://api.github.com/repos/akeneo/pim-community-dev","forks_url":"https://api.github.com/repos/akeneo/pim-community-dev/forks","keys_url":"https://api.github.com/repos/akeneo/pim-community-dev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akeneo/pim-community-dev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akeneo/pim-community-dev/teams","hooks_url":"https://api.github.com/repos/akeneo/pim-community-dev/hooks","issue_events_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/events{/number}","events_url":"https://api.github.com/repos/akeneo/pim-community-dev/events","assignees_url":"https://api.github.com/repos/akeneo/pim-community-dev/assignees{/user}","branches_url":"https://api.github.com/repos/akeneo/pim-community-dev/branches{/branch}","tags_url":"https://api.github.com/repos/akeneo/pim-community-dev/tags","blobs_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/refs{/sha}","trees_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akeneo/pim-community-dev/statuses/{sha}","languages_url":"https://api.github.com/repos/akeneo/pim-community-dev/languages","stargazers_url":"https://api.github.com/repos/akeneo/pim-community-dev/stargazers","contributors_url":"https://api.github.com/repos/akeneo/pim-community-dev/contributors","subscribers_url":"https://api.github.com/repos/akeneo/pim-community-dev/subscribers","subscription_url":"https://api.github.com/repos/akeneo/pim-community-dev/subscription","commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/commits{/sha}","git_commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/commits{/sha}","comments_url":"https://api.github.com/repos/akeneo/pim-community-dev/comments{/number}","issue_comment_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/comments{/number}","contents_url":"https://api.github.com/repos/akeneo/pim-community-dev/contents/{+path}","compare_url":"https://api.github.com/repos/akeneo/pim-community-dev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akeneo/pim-community-dev/merges","archive_url":"https://api.github.com/repos/akeneo/pim-community-dev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akeneo/pim-community-dev/downloads","issues_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues{/number}","pulls_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls{/number}","milestones_url":"https://api.github.com/repos/akeneo/pim-community-dev/milestones{/number}","notifications_url":"https://api.github.com/repos/akeneo/pim-community-dev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akeneo/pim-community-dev/labels{/name}","releases_url":"https://api.github.com/repos/akeneo/pim-community-dev/releases{/id}","deployments_url":"https://api.github.com/repos/akeneo/pim-community-dev/deployments","created_at":"2012-08-10T09:27:26Z","updated_at":"2018-10-02T11:54:50Z","pushed_at":"2018-10-02T14:33:42Z","git_url":"git://github.com/akeneo/pim-community-dev.git","ssh_url":"git@github.com:akeneo/pim-community-dev.git","clone_url":"https://github.com/akeneo/pim-community-dev.git","svn_url":"https://github.com/akeneo/pim-community-dev","homepage":"http://www.akeneo.com","size":148666,"stargazers_count":546,"watchers_count":546,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":328,"mirror_url":null,"archived":false,"open_issues_count":274,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":328,"open_issues":274,"watchers":546,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/8918"},"html":{"href":"https://github.com/akeneo/pim-community-dev/pull/8918"},"issue":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/issues/8918"},"comments":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/issues/8918/comments"},"review_comments":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/8918/comments"},"review_comment":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/8918/commits"},"statuses":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/statuses/36d9bc6f2159bb830b29b43531cc6d9d294b839c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"BitOne"}}