aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/group.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/engine/lib/group.php b/engine/lib/group.php
index c6bd27f2d..3b42de02f 100644
--- a/engine/lib/group.php
+++ b/engine/lib/group.php
@@ -567,8 +567,10 @@ function is_group_member($group_guid, $user_guid) {
function join_group($group_guid, $user_guid) {
$result = add_entity_relationship($user_guid, 'member', $group_guid);
- $params = array('group' => get_entity($group_guid), 'user' => get_entity($user_guid));
- elgg_trigger_event('join', 'group', $params);
+ if ($result) {
+ $params = array('group' => get_entity($group_guid), 'user' => get_entity($user_guid));
+ elgg_trigger_event('join', 'group', $params);
+ }
return $result;
}