Skip to:
Content

BuddyPress.org

Changeset 7453


Ignore:
Timestamp:
10/22/2013 02:17:18 AM (11 years ago)
Author:
boonebgorges
Message:

Fix logic error introduced into group template setup in r7442

Template variables were getting overwritten because of incorrect placement
in the loop.

See #5032

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-classes.php

    r7442 r7453  
    850850
    851851        for ( $i = 0, $count = count( $paged_groups ); $i < $count; ++$i ) {
    852             $paged_groups[$i]->is_member = false;
    853 
    854852            foreach ( (array) $user_status as $group ) {
    855                 $is_member = $is_invited = $is_pending = false;
    856853                if ( $group->group_id == $paged_groups[ $i ]->id ) {
     854                    $is_member = $is_invited = $is_pending = '0';
     855
    857856                    // is_confirmed means the user is a member
    858857                    if ( $group->is_confirmed ) {
    859                         $is_member = true;
     858                        $is_member = '1';
    860859
    861860                    // invite_sent means the user has been invited
    862861                    } else if ( $group->invite_sent ) {
    863                         $is_invited = true;
     862                        $is_invited = '1';
    864863
    865864                    // User has sent request, but has not been confirmed
    866865                    } else {
    867                         $is_pending = true;
     866                        $is_pending = '1';
    868867                    }
     868
     869                    $paged_groups[ $i ]->is_member = $is_member;
     870                    $paged_groups[ $i ]->is_invited = $is_invited;
     871                    $paged_groups[ $i ]->is_pending = $is_pending;
    869872                }
    870 
    871                 $paged_groups[ $i ]->is_member = $is_member;
    872                 $paged_groups[ $i ]->is_invited = $is_invited;
    873                 $paged_groups[ $i ]->is_pending = $is_pending;
    874873            }
    875874        }
Note: See TracChangeset for help on using the changeset viewer.