backdrop-contrib / og

The Organic Groups module provides users the ability to create, manage, and delete 'groups' on a site.
GNU General Public License v2.0
1 stars 8 forks source link

Issue #34. Correctly remove field data, info and instance when uninstalling #113

Closed argiepiano closed 2 years ago

argiepiano commented 2 years ago

Fixes #34.

Explanation: there were two problems:

  1. Field og_membership_request not being removed at all (field info, field instance and data). This happens also in the D7 version. The entity to which it's attached, og_membership, has been deleted and therefore the removal of the field needed some special treatment
  2. Other OG fields attached to core entities were marked as deleted (info and instance), but the table was not removed. Running cron took care of removing everything. So, to solve this without waiting until cron ran, I used field_purge_batch at the end of the uninstall hook, as recommended in some D7 posts.

Tested thoroughly - working fine.