Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/25/2018 11:29:28 PM (6 years ago)
Author:
r-a-y
Message:

Groups: Fix display of "Comment" button in the activity stream.

In r11959, the banned group members check is using the wrong conditional.
This caused legitimate group members to never see the "Comment" button in
the activity stream.

This commit reverses the check and adds some unit tests (which should have
been written beforehand!).

Anti-props r-a-y.

See #4429.

Fixes #7854 (3.x branch).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/src/bp-groups/bp-groups-activity.php

    r12123 r12131  
    393393    // If current user is not a group member or is banned, user cannot comment.
    394394    if ( ! bp_current_user_can( 'bp_moderate' ) &&
    395         ( ! groups_is_user_member( bp_loggedin_user_id(), $group_id ) || ! groups_is_user_banned( bp_loggedin_user_id(), $group_id ) )
     395        ( ! groups_is_user_member( bp_loggedin_user_id(), $group_id ) || groups_is_user_banned( bp_loggedin_user_id(), $group_id ) )
    396396    ) {
    397397        $retval = false;
Note: See TracChangeset for help on using the changeset viewer.