aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mod/groups/actions/groups/membership/join.php2
-rw-r--r--mod/groups/start.php3
2 files changed, 4 insertions, 1 deletions
diff --git a/mod/groups/actions/groups/membership/join.php b/mod/groups/actions/groups/membership/join.php
index edcffb507..210e285a5 100644
--- a/mod/groups/actions/groups/membership/join.php
+++ b/mod/groups/actions/groups/membership/join.php
@@ -15,7 +15,7 @@ $group_guid = get_input('group_guid');
$user = get_entity($user_guid);
-// @todo investigate if the access bypass is needed
+// access bypass for getting invisible group
$ia = elgg_set_ignore_access(true);
$group = get_entity($group_guid);
elgg_set_ignore_access($ia);
diff --git a/mod/groups/start.php b/mod/groups/start.php
index d4649c90b..f8cff6a8a 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -447,6 +447,9 @@ function groups_join_group($group, $user) {
elgg_set_ignore_access($ia);
if ($result) {
+ // flush user's access info so the collection is added
+ get_access_list($user->guid, 0, true);
+
// Remove any invite or join request flags
remove_entity_relationship($group->guid, 'invited', $user->guid);
remove_entity_relationship($user->guid, 'membership_request', $group->guid);