Skip to content

Commit

Permalink
fix(groups): multiple membership requests don't trigger messages
Browse files Browse the repository at this point in the history
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 287e644
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mod/groups/actions/groups/membership/join.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
} else { } else {
register_error(elgg_echo("groups:cantjoin")); register_error(elgg_echo("groups:cantjoin"));
} }
} elseif (check_entity_relationship($user->guid, 'membership_request', $group->guid)) {
register_error(elgg_echo("groups:joinrequest:exists"));
} else { } else {
add_entity_relationship($user->guid, 'membership_request', $group->guid); add_entity_relationship($user->guid, 'membership_request', $group->guid);


Expand Down
1 change: 1 addition & 0 deletions mod/groups/languages/en.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
'groups:addedtogroup' => 'Successfully added the user to the group', 'groups:addedtogroup' => 'Successfully added the user to the group',
'groups:joinrequestnotmade' => 'Could not request to join group', 'groups:joinrequestnotmade' => 'Could not request to join group',
'groups:joinrequestmade' => 'Requested 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:joined' => 'Successfully joined group!',
'groups:left' => 'Successfully left group', 'groups:left' => 'Successfully left group',
'groups:notowner' => 'Sorry, you are not the owner of this group.', 'groups:notowner' => 'Sorry, you are not the owner of this group.',
Expand Down

0 comments on commit 287e644

Please sign in to comment.