diff --git a/actions/move.php b/actions/move.php index a8c0adf..9155b7c 100644 --- a/actions/move.php +++ b/actions/move.php @@ -78,8 +78,9 @@ $invite = array(); foreach ($batch as $member) { - if (!is_group_member($parent_guid, $member->guid)) { - $invite[] = $member->guid; + $member_guid = $member->guid; + if (!is_group_member($parent_guid, $member_guid)) { + $invite[] = $member_guid; // the user isn't a member of the parent group // so we have to remove them from this subgroup, and all subgroups of this subgroup // and send them an invitation diff --git a/lib/functions.php b/lib/functions.php index 253988f..5a4bb3a 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -251,7 +251,14 @@ function join_parents_recursive($group, $user = NULL) { while ($parent = get_parent_group($group)) { if (!$parent->isMember($user)) { - $parent->join($user); + if ($parent->join($user)) { + elgg_create_river_item(array( + 'view' => 'river/relationship/member/create', + 'action_type' => 'join', + 'subject_guid' => $user->guid, + 'object_guid' => $parent->guid, + )); + } } $group = $parent;