{"action":"created","issue":{"url":"https://api.github.com/repos/GeoNode/geonode/issues/3745","repository_url":"https://api.github.com/repos/GeoNode/geonode","labels_url":"https://api.github.com/repos/GeoNode/geonode/issues/3745/labels{/name}","comments_url":"https://api.github.com/repos/GeoNode/geonode/issues/3745/comments","events_url":"https://api.github.com/repos/GeoNode/geonode/issues/3745/events","html_url":"https://github.com/GeoNode/geonode/issues/3745","id":313158430,"number":3745,"title":"Adding linked document deletes all other linked documents","user":{"login":"JonDHo","id":3302774,"avatar_url":"https://avatars2.githubusercontent.com/u/3302774?v=4","gravatar_id":"","url":"https://api.github.com/users/JonDHo","html_url":"https://github.com/JonDHo","followers_url":"https://api.github.com/users/JonDHo/followers","following_url":"https://api.github.com/users/JonDHo/following{/other_user}","gists_url":"https://api.github.com/users/JonDHo/gists{/gist_id}","starred_url":"https://api.github.com/users/JonDHo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonDHo/subscriptions","organizations_url":"https://api.github.com/users/JonDHo/orgs","repos_url":"https://api.github.com/users/JonDHo/repos","events_url":"https://api.github.com/users/JonDHo/events{/privacy}","received_events_url":"https://api.github.com/users/JonDHo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-11T03:11:07Z","updated_at":"2018-04-11T03:42:18Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Starting with no linked documents in Geonode, the first time you link a document to any layer (via upload or via adding the link in the metadata screens), everything works as expected. \r\n\r\nWhen linking a second document to any layer (the same or different to the first), the previous link is deleted and only the new link exists. \r\n\r\nIt seems as though any time a document is linked to a layer, all other links in the documents_documentresourcelink table are removed. This happens whether you are just adding a link or uploading. I assume this is not intended behaviour.\r\n\r\nThis can be resolved by commenting out lines 84 and 85 in /geonode/documents/forms.py, but I am not sure what other role these lines are serving:\r\nhttps://github.com/GeoNode/geonode/blob/5141963be5ff5477db4a3633508d3665ba170821/geonode/documents/forms.py#L84-L85\r\n"},"comment":{"url":"https://api.github.com/repos/GeoNode/geonode/issues/comments/380317424","html_url":"https://github.com/GeoNode/geonode/issues/3745#issuecomment-380317424","issue_url":"https://api.github.com/repos/GeoNode/geonode/issues/3745","id":380317424,"user":{"login":"JonDHo","id":3302774,"avatar_url":"https://avatars2.githubusercontent.com/u/3302774?v=4","gravatar_id":"","url":"https://api.github.com/users/JonDHo","html_url":"https://github.com/JonDHo","followers_url":"https://api.github.com/users/JonDHo/followers","following_url":"https://api.github.com/users/JonDHo/following{/other_user}","gists_url":"https://api.github.com/users/JonDHo/gists{/gist_id}","starred_url":"https://api.github.com/users/JonDHo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonDHo/subscriptions","organizations_url":"https://api.github.com/users/JonDHo/orgs","repos_url":"https://api.github.com/users/JonDHo/repos","events_url":"https://api.github.com/users/JonDHo/events{/privacy}","received_events_url":"https://api.github.com/users/JonDHo/received_events","type":"User","site_admin":false},"created_at":"2018-04-11T03:42:18Z","updated_at":"2018-04-11T03:42:18Z","author_association":"CONTRIBUTOR","body":"It appears as though this line is the only line which enables deleting of links. The issue appears to be that it is just deleting links for all rows in the documents_documentresourcelink  table, not just the target resource."}}
{"actor":{"display_login":"JonDHo"}}