amitaibu / og

A fork to work on OG8
https://github.com/Gizra/og
29 stars 16 forks source link

Delete memberships when a group is deleted #176

Open pfrenssen opened 8 years ago

pfrenssen commented 8 years ago

In PR #162 the group content is cleaned up when a group is deleted. We also need to clean up group memberships when this happens.

Ref og_entity_predelete()

weitzman commented 7 years ago

Not having this is a real bother for migration where we frequently rollback the creation of groups but the memberships stick around. Is there any reason why this should not be implemented?

amitaibu commented 7 years ago

Should be implemented. Would love a PR down in https://github.com/Gizra/og :)

pfrenssen commented 7 years ago

This was implemented in https://github.com/amitaibu/og/pull/179. If you want the memberships to be deleted immediately when the group is deleted, then set the deletion method to 'Simple' in /admin/config/group/settings. If this is left on the default setting the orphans will be deleted in a batch process which might not be triggered if you do a migration rollback.

Of course it is also possible that there is a bug somewhere that is preventing the memberships from being deleted :)

amitaibu commented 7 years ago

Oh right, I completely forgot we had that in. Thanks!

pfrenssen commented 7 years ago

This issue was about cleaning up memberships after deleting a group, but they also need to be cleaned up after deleting a user. PR for this in https://github.com/Gizra/og/pull/291