{"action":"created","comment":{"url":"https://api.github.com/repos/kuali/kc/pulls/comments/23416499","id":23416499,"diff_hunk":"@@ -736,42 +740,48 @@ protected void syncAllPersonnelAttachments(DevelopmentProposal hierarchyProposal\n          Go thro list of personBios in child, if it is not in multiple proposals, then remove instance from parent so you\n          can copy over again.\n          */\n-        for (Iterator<ProposalPersonBiography> iteratorChild = childProposal.getPropPersonBios().iterator(); iteratorChild.hasNext();) {\n-            ProposalPersonBiography srcPropPersonBio = iteratorChild.next();\n-\n-            if (!personInMultipleProposals(srcPropPersonBio.getPersonId(), hierarchyProposal)) {\n-                // mark those persons that are not in multiple proposals since they will be copied over later\n-                personInMultipleProp.put(srcPropPersonBio.getPersonId(), false);\n-                for (Iterator<ProposalPersonBiography> iteratorParent = hierarchyProposal.getPropPersonBios().iterator(); iteratorParent.hasNext();) {\n-                    ProposalPersonBiography parentPropPersonBio = iteratorParent.next();\n-                    if (StringUtils.equals(srcPropPersonBio.getPersonId(), parentPropPersonBio.getPersonId())) {\n-                        iteratorParent.remove();\n-                    }\n+\n+            for (Iterator<ProposalPersonBiography> iteratorChild = childProposal.getPropPersonBios().iterator(); iteratorChild.hasNext(); ) {\n+                ProposalPersonBiography srcPropPersonBio = iteratorChild.next();\n+                // if the proposal is JUST being linked to a hierarchy and if this proposal has bios for\n+                // people that exist on the parent, ignore those bios.\n+                if (!isBioInNewChildDuplicate(isNewChild, hierarchyProposal, srcPropPersonBio)\n+                        && !personInMultipleProposals(srcPropPersonBio.getPersonId(), hierarchyProposal)) {\n+                        // mark those persons that are not in multiple proposals\n+                        // and remove this persons bio from parent\n+                        // since they will be copied over again later. We need to do this so if a bio is updated at the\n+                        // child it will sync up.\n+                        personInMultipleProp.put(srcPropPersonBio.getPersonId(), false);\n+                        for (Iterator<ProposalPersonBiography> iteratorParent = hierarchyProposal.getPropPersonBios().iterator(); iteratorParent.hasNext(); ) {\n+                            ProposalPersonBiography parentPropPersonBio = iteratorParent.next();\n+                            if (StringUtils.equals(srcPropPersonBio.getPersonId(), parentPropPersonBio.getPersonId())) {\n+                                iteratorParent.remove();\n+                            }\n+                        }\n                 }\n             }\n-        }\n-\n-        // go over the child bios list and if person is not in multiple proposals and the\n-        // bio does not exist for the person in the parent, add that bio\n-        for (ProposalPersonBiography srcPropPersonBio : childProposal.getPropPersonBios()) {\n-            if (personInMultipleProp.get(srcPropPersonBio.getPersonId()) != null &&\n-                    !personInMultipleProp.get(srcPropPersonBio.getPersonId()) &&\n-                    !isDuplicateBio(srcPropPersonBio, hierarchyProposal)) {\n-                ProposalPersonBiography destPropPersonBio;\n-                destPropPersonBio = (ProposalPersonBiography) deepCopy(srcPropPersonBio);\n-                destPropPersonBio.setDevelopmentProposal(hierarchyProposal);\n-                destPropPersonBio.setProposalNumber(hierarchyProposal.getProposalNumber());\n-                destPropPersonBio.setProposalPersonNumber(getProposalPersonNumber(destPropPersonBio.getPersonId(), hierarchyProposal));\n-                destPropPersonBio.setVersionNumber(0L);\n-                newList.add(destPropPersonBio);\n \n+            // go over the child bios list and if person is not in multiple proposals add it\n+            for (ProposalPersonBiography srcPropPersonBio : childProposal.getPropPersonBios()) {\n+                // if the proposal is JUST being linked to a hierarchy and if this proposal has bios for\n+                // people that exist on the parent, ignore those bios.\n+                if (!isBioInNewChildDuplicate(isNewChild, hierarchyProposal, srcPropPersonBio)\n+                    && personInMultipleProp.get(srcPropPersonBio.getPersonId()) != null &&\n+                    !personInMultipleProp.get(srcPropPersonBio.getPersonId())) {","path":"coeus-impl/src/main/java/org/kuali/coeus/propdev/impl/hierarchy/ProposalHierarchyServiceImpl.java","position":133,"original_position":133,"commit_id":"14433482222057d6323255c89ff006656b3387b6","original_commit_id":"14433482222057d6323255c89ff006656b3387b6","user":{"login":"gathreya","id":6466224,"avatar_url":"https://avatars.githubusercontent.com/u/6466224?v=3","gravatar_id":"","url":"https://api.github.com/users/gathreya","html_url":"https://github.com/gathreya","followers_url":"https://api.github.com/users/gathreya/followers","following_url":"https://api.github.com/users/gathreya/following{/other_user}","gists_url":"https://api.github.com/users/gathreya/gists{/gist_id}","starred_url":"https://api.github.com/users/gathreya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gathreya/subscriptions","organizations_url":"https://api.github.com/users/gathreya/orgs","repos_url":"https://api.github.com/users/gathreya/repos","events_url":"https://api.github.com/users/gathreya/events{/privacy}","received_events_url":"https://api.github.com/users/gathreya/received_events","type":"User","site_admin":false},"body":"Yeah, when I initially added it, I meant to use it for more than just a check but never ended up using it that way. I would rather not change this now though if it is minor. This code change itself I think risky at this point and if more hierarchy personnel attachments issues are filed, I am going to revert.","created_at":"2015-01-22T22:32:28Z","updated_at":"2015-01-22T22:32:28Z","html_url":"https://github.com/kuali/kc/pull/1505#discussion_r23416499","pull_request_url":"https://api.github.com/repos/kuali/kc/pulls/1505","_links":{"self":{"href":"https://api.github.com/repos/kuali/kc/pulls/comments/23416499"},"html":{"href":"https://github.com/kuali/kc/pull/1505#discussion_r23416499"},"pull_request":{"href":"https://api.github.com/repos/kuali/kc/pulls/1505"}}},"pull_request":{"url":"https://api.github.com/repos/kuali/kc/pulls/1505","id":27815074,"html_url":"https://github.com/kuali/kc/pull/1505","diff_url":"https://github.com/kuali/kc/pull/1505.diff","patch_url":"https://github.com/kuali/kc/pull/1505.patch","issue_url":"https://api.github.com/repos/kuali/kc/issues/1505","number":1505,"state":"open","locked":false,"title":"KRACOEUS-8723: fixing personnel attachments sync behavior","user":{"login":"gathreya","id":6466224,"avatar_url":"https://avatars.githubusercontent.com/u/6466224?v=3","gravatar_id":"","url":"https://api.github.com/users/gathreya","html_url":"https://github.com/gathreya","followers_url":"https://api.github.com/users/gathreya/followers","following_url":"https://api.github.com/users/gathreya/following{/other_user}","gists_url":"https://api.github.com/users/gathreya/gists{/gist_id}","starred_url":"https://api.github.com/users/gathreya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gathreya/subscriptions","organizations_url":"https://api.github.com/users/gathreya/orgs","repos_url":"https://api.github.com/users/gathreya/repos","events_url":"https://api.github.com/users/gathreya/events{/privacy}","received_events_url":"https://api.github.com/users/gathreya/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-22T03:07:56Z","updated_at":"2015-01-22T22:32:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09b35ab9f8fcec2cc07ac734337469fc6b9a8c7d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kuali/kc/pulls/1505/commits","review_comments_url":"https://api.github.com/repos/kuali/kc/pulls/1505/comments","review_comment_url":"https://api.github.com/repos/kuali/kc/pulls/comments/{number}","comments_url":"https://api.github.com/repos/kuali/kc/issues/1505/comments","statuses_url":"https://api.github.com/repos/kuali/kc/statuses/14433482222057d6323255c89ff006656b3387b6","head":{"label":"gathreya:KRACOEUS-8723-unusualSyncAttachBehavior","ref":"KRACOEUS-8723-unusualSyncAttachBehavior","sha":"14433482222057d6323255c89ff006656b3387b6","user":{"login":"gathreya","id":6466224,"avatar_url":"https://avatars.githubusercontent.com/u/6466224?v=3","gravatar_id":"","url":"https://api.github.com/users/gathreya","html_url":"https://github.com/gathreya","followers_url":"https://api.github.com/users/gathreya/followers","following_url":"https://api.github.com/users/gathreya/following{/other_user}","gists_url":"https://api.github.com/users/gathreya/gists{/gist_id}","starred_url":"https://api.github.com/users/gathreya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gathreya/subscriptions","organizations_url":"https://api.github.com/users/gathreya/orgs","repos_url":"https://api.github.com/users/gathreya/repos","events_url":"https://api.github.com/users/gathreya/events{/privacy}","received_events_url":"https://api.github.com/users/gathreya/received_events","type":"User","site_admin":false},"repo":{"id":21741102,"name":"kc","full_name":"gathreya/kc","owner":{"login":"gathreya","id":6466224,"avatar_url":"https://avatars.githubusercontent.com/u/6466224?v=3","gravatar_id":"","url":"https://api.github.com/users/gathreya","html_url":"https://github.com/gathreya","followers_url":"https://api.github.com/users/gathreya/followers","following_url":"https://api.github.com/users/gathreya/following{/other_user}","gists_url":"https://api.github.com/users/gathreya/gists{/gist_id}","starred_url":"https://api.github.com/users/gathreya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gathreya/subscriptions","organizations_url":"https://api.github.com/users/gathreya/orgs","repos_url":"https://api.github.com/users/gathreya/repos","events_url":"https://api.github.com/users/gathreya/events{/privacy}","received_events_url":"https://api.github.com/users/gathreya/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gathreya/kc","description":"Kuali Coeus","fork":true,"url":"https://api.github.com/repos/gathreya/kc","forks_url":"https://api.github.com/repos/gathreya/kc/forks","keys_url":"https://api.github.com/repos/gathreya/kc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gathreya/kc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gathreya/kc/teams","hooks_url":"https://api.github.com/repos/gathreya/kc/hooks","issue_events_url":"https://api.github.com/repos/gathreya/kc/issues/events{/number}","events_url":"https://api.github.com/repos/gathreya/kc/events","assignees_url":"https://api.github.com/repos/gathreya/kc/assignees{/user}","branches_url":"https://api.github.com/repos/gathreya/kc/branches{/branch}","tags_url":"https://api.github.com/repos/gathreya/kc/tags","blobs_url":"https://api.github.com/repos/gathreya/kc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gathreya/kc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gathreya/kc/git/refs{/sha}","trees_url":"https://api.github.com/repos/gathreya/kc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gathreya/kc/statuses/{sha}","languages_url":"https://api.github.com/repos/gathreya/kc/languages","stargazers_url":"https://api.github.com/repos/gathreya/kc/stargazers","contributors_url":"https://api.github.com/repos/gathreya/kc/contributors","subscribers_url":"https://api.github.com/repos/gathreya/kc/subscribers","subscription_url":"https://api.github.com/repos/gathreya/kc/subscription","commits_url":"https://api.github.com/repos/gathreya/kc/commits{/sha}","git_commits_url":"https://api.github.com/repos/gathreya/kc/git/commits{/sha}","comments_url":"https://api.github.com/repos/gathreya/kc/comments{/number}","issue_comment_url":"https://api.github.com/repos/gathreya/kc/issues/comments/{number}","contents_url":"https://api.github.com/repos/gathreya/kc/contents/{+path}","compare_url":"https://api.github.com/repos/gathreya/kc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gathreya/kc/merges","archive_url":"https://api.github.com/repos/gathreya/kc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gathreya/kc/downloads","issues_url":"https://api.github.com/repos/gathreya/kc/issues{/number}","pulls_url":"https://api.github.com/repos/gathreya/kc/pulls{/number}","milestones_url":"https://api.github.com/repos/gathreya/kc/milestones{/number}","notifications_url":"https://api.github.com/repos/gathreya/kc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gathreya/kc/labels{/name}","releases_url":"https://api.github.com/repos/gathreya/kc/releases{/id}","created_at":"2014-07-11T15:21:52Z","updated_at":"2015-01-12T16:44:59Z","pushed_at":"2015-01-22T03:07:17Z","git_url":"git://github.com/gathreya/kc.git","ssh_url":"git@github.com:gathreya/kc.git","clone_url":"https://github.com/gathreya/kc.git","svn_url":"https://github.com/gathreya/kc","homepage":"http://www.kuali.org/kc","size":340859,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kuali:master","ref":"master","sha":"aab37797a84d71f9e65b9bbf6897ba2b8504cdea","user":{"login":"kuali","id":371097,"avatar_url":"https://avatars.githubusercontent.com/u/371097?v=3","gravatar_id":"","url":"https://api.github.com/users/kuali","html_url":"https://github.com/kuali","followers_url":"https://api.github.com/users/kuali/followers","following_url":"https://api.github.com/users/kuali/following{/other_user}","gists_url":"https://api.github.com/users/kuali/gists{/gist_id}","starred_url":"https://api.github.com/users/kuali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuali/subscriptions","organizations_url":"https://api.github.com/users/kuali/orgs","repos_url":"https://api.github.com/users/kuali/repos","events_url":"https://api.github.com/users/kuali/events{/privacy}","received_events_url":"https://api.github.com/users/kuali/received_events","type":"Organization","site_admin":false},"repo":{"id":16106733,"name":"kc","full_name":"kuali/kc","owner":{"login":"kuali","id":371097,"avatar_url":"https://avatars.githubusercontent.com/u/371097?v=3","gravatar_id":"","url":"https://api.github.com/users/kuali","html_url":"https://github.com/kuali","followers_url":"https://api.github.com/users/kuali/followers","following_url":"https://api.github.com/users/kuali/following{/other_user}","gists_url":"https://api.github.com/users/kuali/gists{/gist_id}","starred_url":"https://api.github.com/users/kuali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuali/subscriptions","organizations_url":"https://api.github.com/users/kuali/orgs","repos_url":"https://api.github.com/users/kuali/repos","events_url":"https://api.github.com/users/kuali/events{/privacy}","received_events_url":"https://api.github.com/users/kuali/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kuali/kc","description":"Kuali Coeus","fork":false,"url":"https://api.github.com/repos/kuali/kc","forks_url":"https://api.github.com/repos/kuali/kc/forks","keys_url":"https://api.github.com/repos/kuali/kc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kuali/kc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kuali/kc/teams","hooks_url":"https://api.github.com/repos/kuali/kc/hooks","issue_events_url":"https://api.github.com/repos/kuali/kc/issues/events{/number}","events_url":"https://api.github.com/repos/kuali/kc/events","assignees_url":"https://api.github.com/repos/kuali/kc/assignees{/user}","branches_url":"https://api.github.com/repos/kuali/kc/branches{/branch}","tags_url":"https://api.github.com/repos/kuali/kc/tags","blobs_url":"https://api.github.com/repos/kuali/kc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kuali/kc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kuali/kc/git/refs{/sha}","trees_url":"https://api.github.com/repos/kuali/kc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kuali/kc/statuses/{sha}","languages_url":"https://api.github.com/repos/kuali/kc/languages","stargazers_url":"https://api.github.com/repos/kuali/kc/stargazers","contributors_url":"https://api.github.com/repos/kuali/kc/contributors","subscribers_url":"https://api.github.com/repos/kuali/kc/subscribers","subscription_url":"https://api.github.com/repos/kuali/kc/subscription","commits_url":"https://api.github.com/repos/kuali/kc/commits{/sha}","git_commits_url":"https://api.github.com/repos/kuali/kc/git/commits{/sha}","comments_url":"https://api.github.com/repos/kuali/kc/comments{/number}","issue_comment_url":"https://api.github.com/repos/kuali/kc/issues/comments/{number}","contents_url":"https://api.github.com/repos/kuali/kc/contents/{+path}","compare_url":"https://api.github.com/repos/kuali/kc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kuali/kc/merges","archive_url":"https://api.github.com/repos/kuali/kc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kuali/kc/downloads","issues_url":"https://api.github.com/repos/kuali/kc/issues{/number}","pulls_url":"https://api.github.com/repos/kuali/kc/pulls{/number}","milestones_url":"https://api.github.com/repos/kuali/kc/milestones{/number}","notifications_url":"https://api.github.com/repos/kuali/kc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kuali/kc/labels{/name}","releases_url":"https://api.github.com/repos/kuali/kc/releases{/id}","created_at":"2014-01-21T15:32:22Z","updated_at":"2015-01-22T21:59:58Z","pushed_at":"2015-01-22T21:59:57Z","git_url":"git://github.com/kuali/kc.git","ssh_url":"git@github.com:kuali/kc.git","clone_url":"https://github.com/kuali/kc.git","svn_url":"https://github.com/kuali/kc","homepage":"http://www.kuali.org/kc","size":723512,"stargazers_count":12,"watchers_count":12,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":51,"mirror_url":null,"open_issues_count":5,"forks":51,"open_issues":5,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kuali/kc/pulls/1505"},"html":{"href":"https://github.com/kuali/kc/pull/1505"},"issue":{"href":"https://api.github.com/repos/kuali/kc/issues/1505"},"comments":{"href":"https://api.github.com/repos/kuali/kc/issues/1505/comments"},"review_comments":{"href":"https://api.github.com/repos/kuali/kc/pulls/1505/comments"},"review_comment":{"href":"https://api.github.com/repos/kuali/kc/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/kuali/kc/pulls/1505/commits"},"statuses":{"href":"https://api.github.com/repos/kuali/kc/statuses/14433482222057d6323255c89ff006656b3387b6"}}}}