Permalink
Browse files

fix(groups): multiple membership requests don't trigger messages

When a user clicked on the 'request membership' button for closed
groups, each requests was handled as a new request. The group admin got
a notification about each new request.
Now the user gets a notification that a request was already made.

fixes: #8901
  • Loading branch information...
jeabakker committed Oct 26, 2016
1 parent e4cfa85 commit 287e64489a8a343fabbc6cf6e12dba86ea7a51b7
Showing with 3 additions and 0 deletions.
  1. +2 −0 mod/groups/actions/groups/membership/join.php
  2. +1 −0 mod/groups/languages/en.php
@@ -43,6 +43,8 @@
} else {
register_error(elgg_echo("groups:cantjoin"));
}
+ } elseif (check_entity_relationship($user->guid, 'membership_request', $group->guid)) {
+ register_error(elgg_echo("groups:joinrequest:exists"));
} else {
add_entity_relationship($user->guid, 'membership_request', $group->guid);
@@ -132,6 +132,7 @@
'groups:addedtogroup' => 'Successfully added the user to the group',
'groups:joinrequestnotmade' => 'Could not request to join group',
'groups:joinrequestmade' => 'Requested to join group',
+ 'groups:joinrequest:exists' => 'You already requested membership for this group',
'groups:joined' => 'Successfully joined group!',
'groups:left' => 'Successfully left group',
'groups:notowner' => 'Sorry, you are not the owner of this group.',

0 comments on commit 287e644

Please sign in to comment.