EPSCoR / ERCore

ERcore content management system to assist with NSF EPSCoR reporting
4 stars 7 forks source link

when deleting Collaborations, associated nodes don't get deleted #12

Closed khuffman closed 9 years ago

khuffman commented 9 years ago

This is an issue we in RI keep hitting from time to time, I reported it to Isis Oct 30, 2014 by email, so now I add to our issue tracker. It is not a bug, maybe a enhancements? Description: When somone deletes a collaboration the External Collaborators "announcements"(node) that the system creates, that says something like "Romeo Catman from Brown Univ. on Tropical Forrest Collaboration", doesn't get deleted when the Collaboration gets deleted.

Here is how to reproduce it:

Shouldn't the External Collaborators (personX and personY is on "Tropical Forrest Collaboration)" be deleted automatically when I delete a Collaboration?

I can of course go under Contents list, see the External Collaborators and delete that entry, but that is one extra step that the user has to remember to do. Also when user deletes a Collaboration it doesn't warn them that the External Collaborators doesn't get deleted.

I think when one deletes a Collaboration from table "node" the rows in field_data_field_er_collab_ref field_data_field_er_collab_name tables associated with that node should be removed as well.

What do you think?

Kia

iserna commented 9 years ago

@khuffman yes, this is an issue and I am sorry it fell off my radar since October 2014 when you first brought it up.

I am now wondering how this effects Template C numbers which I will test and report back. It has been an issue for me in the past and would love to see all associated nodes removed as well. Though, at this moment in time I have no idea how to do that.

Mary Jo, Chris, and I are scheduled to start talking about the most recent update requests to collaborations today (non-participants getting counted at participating institutions). I will add this to the discussion.

Thanks, Isis

aturling commented 9 years ago

I looked into this issue a little bit and found this Drupal module that deletes referenced nodes of a node being deleted:

https://www.drupal.org/project/ercd

I tested it out using these settings: Under Modules -> Entity Reference Cascade Delete -> Configure:

Then under Modules -> Entity Reference Cascade Delete -> Permissions:

Then I logged in as a test faculty user and added a collaboration with two external collaborators. I deleted the collaboration and a message popped up asking if I wanted to delete the external collaborators as well. I left the boxes checked (they're checked by default) so that the collaborators would be deleted, and clicking "delete" removed all three nodes (the collaboration + the two collaborators). It worked similarly for deleting calendar events with external engagement data attached - deleted both the event and the external engagement.

khuffman commented 9 years ago

@aturling Thank you, this is very helpful! I will follow your instructions and try it out on our test site to see how it works. Thanks! Kia

On 04/13/2015 12:26 PM, Amy Walsh wrote:

I looked into this issue a little bit and found this Drupal module that deletes referenced nodes of a node being deleted:

https://www.drupal.org/project/ercd

I tested it out using these settings: Under Modules -> Entity Reference Cascade Delete -> Configure:

  • I selected "children referencing parent"
  • I selected the nodes calendar events/external engagements and collaborations/external collaborators; left "user" unselected

Then under Modules -> Entity Reference Cascade Delete -> Permissions:

  • I kept the first two, administer module settings and perform cascade delete on all entities as admin only
  • I allowed faculty/students/admin staff/etc. (anyone who is allowed to view and create EPSCoR content) to cascade delete on calendar events and collaborations
  • I kept all of the boxes unchecked for all of the "user" permissions so that no one (not even admins) can cascade delete users

Then I logged in as a test faculty user and added a collaboration with two external collaborators. I deleted the collaboration and a message popped up asking if I wanted to delete the external collaborators as well. I left the boxes checked (they're checked by default) so that the collaborators would be deleted, and clicking "delete" removed all three nodes (the collaboration + the two collaborators). It worked similarly for deleting calendar events with external engagement data attached - deleted both the event and the external engagement.

— Reply to this email directly or view it on GitHub https://github.com/EPSCoR/ERCore-3.0/issues/12#issuecomment-92416913.

cjallen-epscor commented 9 years ago

I installed and tested this out. Nice! Works as expected.

screen shot 2015-04-16 at 3 56 09 pm

The two users (Gary and Supreme) were deleted from my Collaboration. I did not have to go in and manually remove them as external collaborators.

Shall we add this as an ERCore module dependency?

cjallen-epscor commented 9 years ago

Once we decide this out as dependency or add information into install.html file this can be pushed in 3.1.1 ? or 3.2 ?

iserna commented 9 years ago

Yes, please add the Entity Reference Cascade Delete module as a dependency to the installation guide and to the er.info file, add to 3.1 release.

cjallen-epscor commented 9 years ago

Added to 3.1 Commits: https://github.com/EPSCoR/ERCore-3.1/commit/e418b588518435f16ba1422f3f10f782ccb7cedb