Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/13/2018 02:01:15 PM (7 years ago)
Author:
dcavins
Message:

Correct bp_user_can() logic error.

In r11776, I introduced a logic error in groups_action_join_group(). The logic should be that if a user can't simply join a group, then we check for outstadning invitations.

See #7610.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/actions/join.php

    r11923 r11971  
    2929    if ( !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) && !groups_is_user_banned( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
    3030
    31         // User wants to join a group that is not public.
    32         if ( bp_current_user_can( 'groups_join_group', array( 'group_id' => $bp->groups->current_group->id ) ) ) {
     31        // User wants to join a group that requires an invitation to join.
     32        if ( ! bp_current_user_can( 'groups_join_group', array( 'group_id' => $bp->groups->current_group->id ) ) ) {
    3333            if ( !groups_check_user_has_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
    3434                bp_core_add_message( __( 'There was an error joining the group.', 'buddypress' ), 'error' );
Note: See TracChangeset for help on using the changeset viewer.