aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-01 01:43:19 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-01 01:43:19 +0000
commite3a44b04c90097e587f9e127e9c8440db405ce22 (patch)
tree2399dd72d160f05d440e4476c6ba0e9c971ff3c3
parent8ae80b58057de76d7b1042d38eb799397fb005c1 (diff)
downloadelgg-e3a44b04c90097e587f9e127e9c8440db405ce22.tar.gz
elgg-e3a44b04c90097e587f9e127e9c8440db405ce22.tar.bz2
Fixes #2561 only triggering join, group event if the add relationship succeeded
git-svn-id: http://code.elgg.org/elgg/trunk@7799 36083f99-b078-4883-b0ff-0f9b5a30f544
-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;
}