From e3a44b04c90097e587f9e127e9c8440db405ce22 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 1 Jan 2011 01:43:19 +0000 Subject: 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 --- engine/lib/group.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engine/lib') 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; } -- cgit v1.2.3