Skip to content

Commit

Permalink
Merge pull request #740 from onesixromcom/fix-deletion-of-blocked-and…
Browse files Browse the repository at this point in the history
…-pending-users

Pending and Blocked users are not removed on user delete.
  • Loading branch information
MPParsley committed May 3, 2022
2 parents 03f8361 + 795c5ec commit 12f7661
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/entityreference/behavior/OgBehaviorHandler.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public function delete($entity_type, $entity, $field, $instance, $langcode, &$it
if (!empty($entity->delete_og_membership)) {
// Delete all OG memberships related to this entity.
$og_memberships = array();
foreach (og_get_entity_groups($entity_type, $entity) as $group_type => $ids) {
$groups = og_get_entity_groups($entity_type, $entity, [OG_STATE_ACTIVE, OG_STATE_PENDING, OG_STATE_BLOCKED]);
foreach ($groups as $group_type => $ids) {
$og_memberships = array_merge($og_memberships, array_keys($ids));
}
if ($og_memberships) {
Expand Down

0 comments on commit 12f7661

Please sign in to comment.