Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting the contributor from an article should also delete the person-org relationship #519

Closed
amruelama opened this issue Apr 20, 2017 · 6 comments

Comments

@amruelama
Copy link
Member

amruelama commented Apr 20, 2017

Deleting the contributor (person related to org) from an article should also delete the author-org relationship and shouldn't have an empty organization listed under the person (see below):

screen shot 2017-04-20 at 12 33 10 pm

screen shot 2017-04-20 at 12 31 57 pm

@lomky
Copy link
Collaborator

lomky commented Apr 21, 2017

Found the root of this problem. The delete path only deletes the relationship between the Publication and the Contributor, but doesn't remove the Contributor.

To fix this, we should check if there are any remaining publications linked to this Contributor, and if not, delete the Contributor object. (Person & Org objects being unaffected).

@lomky
Copy link
Collaborator

lomky commented Apr 21, 2017

Code of interest is in lib/Tuba/Controller.pm in the method update_contributors

@amruelama
Copy link
Member Author

Solving this issue will also solve the future additions/deletions that may lead to #357

@lomky
Copy link
Collaborator

lomky commented Apr 21, 2017

Okay, changes made.

  • Deleting one of many relationships does not remove the contributor - publication map
  • Deleteing the only relationship does remove the map
  • deleting the map is now properly audited

screen shot 2017-04-21 at 2 55 01 pm

1 hour ago before code change
14 minutes ago after code change

@lomky
Copy link
Collaborator

lomky commented Apr 21, 2017

@amruelama I have this running on the data-review instance. Could you please test it there and confirm it is working as you expect?

@amruelama
Copy link
Member Author

amruelama commented Apr 21, 2017

Tested for a couple articles and it works well! @lomky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants