Skip to:
Content

BuddyPress.org

Ticket #1728: errors.2.patch

File errors.2.patch, 21.9 KB (added by AD7six, 15 years ago)
  • bp-activity.php

     
    77        global $bp, $wpdb, $current_blog;
    88
    99        if ( !defined( 'BP_ACTIVITY_SLUG' ) )
    10                 define ( 'BP_ACTIVITY_SLUG', $bp->pages->activity->slug );
     10                if ( !empty( $bp->pages->activity->slug ) ) {
     11                        define ( 'BP_ACTIVITY_SLUG', $bp->pages->activity->slug );
     12                } else {
     13                        define ( 'BP_ACTIVITY_SLUG', '' );
     14                }
    1115
    1216        /* For internal identification */
    1317        $bp->activity->id = 'activity';
    14         $bp->activity->name = $bp->pages->activity->name;
     18        if ( !empty( $bp->pages->activity->name ) ) {
     19                $bp->activity->name = $bp->pages->activity->name;
     20        } else {
     21                $bp->activity->name = '';
     22        }
    1523        $bp->activity->slug = BP_ACTIVITY_SLUG;
    1624
    1725        $bp->activity->table_name = $wpdb->base_prefix . 'bp_activity';
  • bp-core/bp-core-signup.php

     
    546546
    547547/* Kill the wp-signup.php if custom registration signup templates are present */
    548548function bp_core_wpsignup_redirect() {
    549         if ( false === strpos( $_SERVER['SCRIPT_NAME'], 'wp-signup.php') && $_GET['action'] != 'register' )
     549        if ( false === strpos( $_SERVER['SCRIPT_NAME'], 'wp-signup.php') && (empty($_GET['action']) || $_GET['action'] != 'register') )
    550550                return false;
    551551
    552552        if ( locate_template( array( 'registration/register.php' ), false ) || locate_template( array( 'register.php' ), false ) )
  • bp-core/bp-core-filters.php

     
    1212function bp_core_exclude_pages( $pages ) {
    1313        global $bp;
    1414
    15         $pages = explode( ',', $pages );
     15        if ( !is_array( $pages ) ) {
     16                $pages = explode( ',', $pages );
     17        }
     18
    1619        $pages[] = $bp->pages->activate->id;
    1720        $pages[] = $bp->pages->register->id;
    1821
  • bp-core/bp-core-notifications.php

     
    4646                $grouped_notifications[$notification->component_name][$notification->component_action][] = $notification;
    4747        }
    4848
    49         if ( !$grouped_notifications )
     49        if ( empty($grouped_notifications) )
    5050                return false;
    5151
    5252        /* Calculated a renderable outcome for each notification type */
  • bp-core/admin/bp-core-upgrade.php

     
    55if ( function_exists( 'register_theme_directory') )
    66        register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' );
    77
     8if (!defined( 'VHOST' ) ) {
     9         define( 'VHOST', 'Obsolete Constant');
     10}
     11
    812class BP_Core_Setup_Wizard {
    913        var $current_step;
    1014        var $steps;
     
    640644                        <h2>Upgrade Complete!</h2>
    641645                <?php endif; ?>
    642646
    643                 <?php?>
    644647                <p><?php printf( __( "You've now completed all of the %s steps and BuddyPress is ready to be activated. Please hit the 'Finish &amp; Activate' button to complete the %s procedure.", 'buddypress' ), $type, $type ) ?></p>
    645648
    646649
     
    677680                        check_admin_referer( 'bpwizard_components' );
    678681
    679682                        // Settings form submitted, now save the settings.
     683                        $disabled = array();
    680684                        foreach ( (array)$_POST['bp_components'] as $key => $value ) {
    681685                                if ( !(int) $value )
    682686                                        $disabled[$key] = 1;
  • bp-core/admin/bp-core-admin.php

     
    2121}
    2222
    2323function bp_core_admin_settings() {
    24         global $wpdb, $bp, $current_blog;
     24        global $wpdb, $bp, $current_blog, $user_ID;
    2525?>
    2626
    2727        <?php
     
    4545                        update_site_option( $key, $value );
    4646                }
    4747        }
     48        $ud = get_userdata($user_ID);
    4849        ?>
    4950
    5051        <div class="wrap">
  • bp-core/admin/bp-core-schema.php

     
    22function bp_core_set_charset() {
    33        global $wpdb;
    44
    5         require_once( ABSPATH . 'wp-admin/upgrade-functions.php' );
     5        require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    66
    77        /* BuddyPress component DB schema */
    88        if ( !empty($wpdb->charset) )
  • bp-core/bp-core-adminbar.php

     
    66        if ( defined( 'BP_DISABLE_ADMIN_BAR' ) )
    77                return false;
    88
    9         if ( (int)$bp->site_options['hide-loggedout-adminbar'] && !is_user_logged_in() )
     9        if ( !empty($bp->site_options['hide-loggedout-adminbar']) && !is_user_logged_in() )
    1010                return false;
    1111
    1212        $bp->doing_admin_bar = true;
     
    7676
    7777                        foreach( (array)$bp->bp_options_nav[$nav_item['slug']] as $subnav_item ) {
    7878                                $link = str_replace( $bp->displayed_user->domain, $bp->loggedin_user->domain, $subnav_item['link'] );
    79                                 $name = str_replace( $bp->displayed_user->userdata->user_login, $bp->loggedin_user->userdata->user_login, $subnav_item['name'] );
     79                                if ( !empty( $bp->displayed_user->userdata->user_login ) ) {
     80                                        $name = str_replace( $bp->displayed_user->userdata->user_login, $bp->loggedin_user->userdata->user_login, $subnav_item['name'] );
     81                                } else {
     82                                        $name = '';
     83                                }
    8084                                $alt = ( 0 == $sub_counter % 2 ) ? ' class="alt"' : '';
    8185                                echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $link . '">' . $name . '</a></li>';
    8286                                $sub_counter++;
  • bp-core/bp-core-templatetags.php

     
    868868function bp_is_blog_page() {
    869869        global $bp, $is_member_page, $wp_query;
    870870
    871         if ( $wp_query->is_home && !$bp->is_directory )
     871        if ( $wp_query->is_home && empty($bp->is_directory) )
    872872                return true;
    873873
    874874        if ( !$bp->displayed_user->id && !$bp->is_single_item && !$bp->is_directory && !bp_core_is_root_component( $bp->current_component ) )
     
    996996                $selection_box .= '<option value="groups">' . __( 'Groups', 'buddypress' ) . '</option>';
    997997        }
    998998
    999         if ( function_exists( 'bp_forums_setup' ) && !(int) $bp->site_options['bp-disable-forum-directory'] ) {
     999        if ( function_exists( 'bp_forums_setup' ) && !empty( $bp->site_options['bp-disable-forum-directory'] ) ) {
    10001000                $selection_box .= '<option value="forums">' . __( 'Forums', 'buddypress' ) . '</option>';
    10011001        }
    10021002
     
    10441044function bp_is_directory() {
    10451045        global $bp;
    10461046
    1047         return $bp->is_directory;
     1047        return !empty( $bp->is_directory );
    10481048}
    10491049
    10501050/**
     
    16641664function bp_is_user_blogs() {
    16651665        global $bp;
    16661666
    1667         if ( $bp->blogs->name == $bp->current_component )
     1667        if ( !empty( $bp->blogs->name ) && $bp->blogs->name == $bp->current_component )
    16681668                return true;
    16691669
    16701670        return false;
     
    16731673function bp_is_user_recent_posts() {
    16741674        global $bp;
    16751675
    1676         if ( $bp->blogs->name == $bp->current_component && 'recent-posts' == $bp->current_action )
     1676        if ( !empty( $bp->blogs->name ) && $bp->blogs->name == $bp->current_component && 'recent-posts' == $bp->current_action )
    16771677                return true;
    16781678
    16791679        return false;
     
    16821682function bp_is_user_recent_commments() {
    16831683        global $bp;
    16841684
    1685         if ( $bp->blogs->name == $bp->current_component && 'recent-comments' == $bp->current_action )
     1685        if ( !empty( $bp->blogs->name ) && $bp->blogs->name == $bp->current_component && 'recent-comments' == $bp->current_action )
    16861686                return true;
    16871687
    16881688        return false;
  • bp-core/bp-core-avatars.php

     
    3232                define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 450 );
    3333
    3434        if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) {
    35                 if ( !$bp->site_options['fileupload_maxk'] )
     35                if ( empty($bp->site_options['fileupload_maxk']) )
    3636                        define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 ); /* 5mb */
    3737                else
    3838                        define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', $bp->site_options['fileupload_maxk'] * 1024 );
  • bp-core/bp-core-catchuri.php

     
    9494        $bp_unfiltered_uri = $bp_uri;
    9595
    9696        /* Find a match within registered BuddyPress controlled WP pages (check members first) */
     97        if (empty( $bp_pages )) {
     98                return false;
     99        }
     100        $matches = array();
    97101        foreach ( (array)$bp_pages as $page_key => $bp_page ) {
    98102                if ( in_array( $bp_page->name, (array)$bp_uri ) ) {
    99103                        /* Match found, now match the slug to make sure. */
     
    120124        }
    121125
    122126        /* This is not a BuddyPress page, so just return. */
    123         if ( in_array( 0, (array) $matches ) )
     127        if ( !$matches || in_array( 0, (array) $matches ) )
    124128                return false;
    125129
    126130        /* Find the offset */
     
    210214        global $post, $bp, $wpdb, $wp_query, $bp_unfiltered_uri, $bp_unfiltered_uri_offset;
    211215
    212216        /* Determine if the root object WP page exists for this request (TODO: is there an API function for this?) */
    213         if ( !$page_exists = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_name = %s", $bp_unfiltered_uri[$bp_unfiltered_uri_offset] ) ) )
     217        if ( empty($bp_unfiltered_uri_offset) || !$page_exists = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_name = %s", $bp_unfiltered_uri[$bp_unfiltered_uri_offset] ) ) )
    214218                return false;
    215219
    216220        /* Set the root object as the current wp_query-ied item */
  • bp-xprofile/bp-xprofile-cssjs.php

     
    66add_action( 'admin_menu', 'xprofile_add_admin_css' );
    77
    88function xprofile_add_admin_js() {
    9         if ( strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
     9        if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
    1010                wp_enqueue_script( 'jquery-ui-sortable' );
    1111                wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . '/bp-xprofile/admin/js/admin.js', array( 'jquery', 'jquery-ui-sortable' ) );
    1212        }
  • bp-xprofile/bp-xprofile-admin.php

     
    6161                        <div id="field-groups">
    6262<?php
    6363                        if ( $groups ) :
    64                                 foreach ( $groups as $group ) { ?>
     64                                foreach ( $groups as $j => $group ) { ?>
    6565
    6666                                                <table id="group_<?php echo $group->id; ?>" class="widefat field-group sortable">
    6767                                                        <thead>
     
    9999                                                        </tfoot>
    100100
    101101                                                        <tbody id="<?php echo $group->id ?>">
    102  <?php 
     102 <?php
    103103                                                                if ( $group->fields ) :
    104104                                                                        foreach ( $group->fields as $field ) {
    105105                                                                                if ( 0 == $j % 2 )
     
    141141                                        <p>
    142142                                                <a class="button" href="admin.php?page=bp-profile-setup&amp;mode=add_group"><?php _e( 'Add New Field Group', 'buddypress' ); ?></a>
    143143                                        </p>
    144 <?php 
     144<?php
    145145                                else :
    146146?>
    147147
  • bp-xprofile/bp-xprofile-classes.php

     
    9191                $r = wp_parse_args( $args, $defaults );
    9292                extract( $r, EXTR_SKIP );
    9393
     94                $group_id_sql = '';
    9495                if ( $profile_group_id )
    9596                        $group_id_sql = $wpdb->prepare( 'WHERE g.id = %d', $profile_group_id );
    9697
  • bp-blogs.php

     
    1010        global $bp, $wpdb;
    1111
    1212        if ( !defined( 'BP_BLOGS_SLUG' ) )
    13                 define ( 'BP_BLOGS_SLUG', $bp->pages->blogs->slug );
     13                if (empty( $bp->pages->blogs ) ) {
     14                        define ( 'BP_BLOGS_SLUG', '' );
     15                } else {
     16                        define ( 'BP_BLOGS_SLUG', $bp->pages->blogs->slug );
     17                        $bp->blogs->name = $bp->pages->blogs->name;
     18                }
    1419
    1520        /* For internal identification */
    1621        $bp->blogs->id = 'blogs';
    17         $bp->blogs->name = $bp->pages->blogs->name;
    1822        $bp->blogs->slug = BP_BLOGS_SLUG;
    1923
    2024        $bp->blogs->table_name = $wpdb->base_prefix . 'bp_user_blogs';
  • bp-messages.php

     
    4040        $messages_link = $bp->loggedin_user->domain . $bp->messages->slug . '/';
    4141
    4242        /* Add the subnav items to the profile */
     43        if ( empty( $count_indicator ) ) {
     44                $count_indicator = 0;
     45        }
    4346        bp_core_new_subnav_item( array( 'name' => __( 'Inbox', 'buddypress' ) . $count_indicator, 'slug' => 'inbox', 'parent_url' => $messages_link, 'parent_slug' => $bp->messages->slug, 'screen_function' => 'messages_screen_inbox', 'position' => 10, 'user_has_access' => bp_is_my_profile() ) );
    4447        bp_core_new_subnav_item( array( 'name' => __( 'Sent Messages', 'buddypress' ), 'slug' => 'sentbox', 'parent_url' => $messages_link, 'parent_slug' => $bp->messages->slug, 'screen_function' => 'messages_screen_sentbox', 'position' => 20, 'user_has_access' => bp_is_my_profile() ) );
    4548        bp_core_new_subnav_item( array( 'name' => __( 'Compose', 'buddypress' ), 'slug' => 'compose', 'parent_url' => $messages_link, 'parent_slug' => $bp->messages->slug, 'screen_function' => 'messages_screen_compose', 'position' => 30, 'user_has_access' => bp_is_my_profile() ) );
  • bp-forums.php

     
    1313        global $bp;
    1414
    1515        if ( !defined( 'BP_FORUMS_SLUG' ) )
    16                 define ( 'BP_FORUMS_SLUG', $bp->pages->forums->slug );
     16                if ( !empty( $bp->pages->forums->slug ) ) {
     17                        define ( 'BP_FORUMS_SLUG', $bp->pages->forums->slug );
     18                } else {
     19                        define ( 'BP_FORUMS_SLUG', '' );
     20                }
    1721
    1822        /* For internal identification */
    1923        $bp->forums->id = 'forums';
    20         $bp->forums->name = $bp->pages->forums->name;
     24        if ( !empty( $bp->pages->forums->name ) ) {
     25                $bp->forums->name = $bp->pages->forums->name;
     26        } else {
     27                $bp->forums->name = '';
     28        }
    2129        $bp->forums->slug = BP_FORUMS_SLUG;
    2230
    2331        $bp->forums->image_base = BP_PLUGIN_URL . '/bp-forums/images';
     
    4351        global $bp;
    4452
    4553        if ( $bp->current_component == $bp->forums->slug ) {
    46                 if ( (int) $bp->site_options['bp-disable-forum-directory'] || !bp_is_active( 'groups' ) )
     54                if ( !empty($bp->site_options['bp-disable-forum-directory']) || !bp_is_active( 'groups' ) )
    4755                        return false;
    4856
    4957                if ( !bp_forums_is_installed_correctly() ) {
     
    500508function bp_forums_filter_caps( $allcaps ) {
    501509        global $bp, $wp_roles, $bb_table_prefix;
    502510
     511        if ( empty( $bp->loggedin_user ) ) {
     512                return $allcaps;
     513        }
     514
    503515        $bb_cap = get_usermeta( $bp->loggedin_user->id, $bb_table_prefix . 'capabilities' );
    504516
    505517        if ( empty( $bb_cap ) )
  • bp-groups.php

     
    88        global $bp, $wpdb;
    99
    1010        if ( !defined( 'BP_GROUPS_SLUG' ) )
    11                 define ( 'BP_GROUPS_SLUG', $bp->pages->groups->slug );
     11                if ( !empty($bp->pages->groups->slug ) ) {
     12                        define ( 'BP_GROUPS_SLUG', $bp->pages->groups->slug );
     13                } else {
     14                        define ( 'BP_GROUPS_SLUG', '' );
     15                }
    1216
    1317        /* For internal identification */
    1418        $bp->groups->id = 'groups';
    15         $bp->groups->name = $bp->pages->groups->name;
     19        if ( !empty($bp->pages->groups->slug ) ) {
     20                $bp->groups->name = $bp->pages->groups->name;
     21        } else {
     22                $bp->groups->name = '';
     23        }
    1624        $bp->groups->slug = BP_GROUPS_SLUG;
    1725
    1826        $bp->groups->table_name = $wpdb->base_prefix . 'bp_groups';
     
    142150                }
    143151        }
    144152
    145         do_action( 'groups_setup_nav', $bp->groups->current_group->user_has_access );
     153        if ( !empty( $bp->groups->current_group->user_has_access  ) ) {
     154                do_action( 'groups_setup_nav', $bp->groups->current_group->user_has_access );
     155        }
    146156}
    147157add_action( 'bp_setup_nav', 'groups_setup_nav' );
    148158
     
    161171function groups_setup_adminbar_menu() {
    162172        global $bp;
    163173
    164         if ( !$bp->groups->current_group )
     174        if ( empty($bp->groups->current_group) )
    165175                return false;
    166176
    167177        /* Don't show this menu to non site admins or if you're viewing your own profile */
  • bp-forums/bp-forums-bbpress.php

     
    6565
    6666        /* This must be loaded before functionss.bb-admin.php otherwise we get a function conflict. */
    6767        if ( !$tables_installed = (boolean) $bbdb->get_results( 'DESCRIBE `' . $bbdb->forums . '`;', ARRAY_A ) )
    68                 require_once( ABSPATH . 'wp-admin/upgrade-functions.php' );
     68                require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    6969
    7070        require_once( BB_PATH . 'bb-admin/includes/functions.bb-admin.php' );
    7171
  • bp-core.php

     
    77 */
    88define( 'BP_PLUGIN_DIR', WP_PLUGIN_DIR . '/buddypress' );
    99define( 'BP_PLUGIN_URL', plugins_url( $path = '/buddypress' ) );
     10define( 'BP_SEARCH_SLUG', 'definition missing' );
    1011
     12if (!defined('VHOST')) {
     13        define('VHOST', 'Obsolete Constant');
     14}
     15
    1116/* Load the WP abstraction file so BuddyPress can run on all WordPress setups. */
    1217require ( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' );
    1318
     
    8388
    8489        /* Set up the members id and active components entry */
    8590        $bp->members->id = 'members';
    86         $bp->members->slug = $bp->pages->members->slug;
     91        if ( empty( $bp->pages->members->slug ) ) {
     92                $bp->members->slug = '';
     93        } else {
     94                $bp->members->slug = $bp->pages->members->slug;
     95        }
    8796        $bp->active_components[$bp->members->slug] = $bp->members->id;
    8897
    8998        /* The user ID of the user who is currently logged in. */
     
    124133
    125134        /* The default component to use if none are set and someone visits: http://domain.com/members/andy */
    126135        if ( !defined( 'BP_DEFAULT_COMPONENT' ) ) {
    127                 if ( isset( $bp->pages->activity ) )
     136                if ( isset( $bp->pages->activity ) ) {
    128137                        $bp->default_component = $bp->pages->activity->name;
    129                 else
     138                } elseif ( !empty( $bp->pages->profile->name ) ) {
    130139                        $bp->default_component = $bp->pages->profile->name;
     140                } else {
     141                        $bp->default_component = '';
     142                }
    131143        } else {
    132144                $bp->default_component = BP_DEFAULT_COMPONENT;
    133145        }
     
    142154        $bp->bp_options_nav = array();
    143155
    144156        /* Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar */
    145         $bp->grav_default->user = apply_filters( 'bp_user_gravatar_default', $bp->site_options['user-avatar-default'] );
     157        $bp->grav_default->user = apply_filters( 'bp_user_gravatar_default', !empty($bp->site_options['user-avatar-default']) );
    146158        $bp->grav_default->group = apply_filters( 'bp_group_gravatar_default', 'identicon' );
    147159        $bp->grav_default->blog = apply_filters( 'bp_blog_gravatar_default', 'identicon' );
    148160
     
    180192function bp_core_define_slugs() {
    181193        global $bp;
    182194
    183         if ( !defined( 'BP_MEMBERS_SLUG' ) )
    184                 define( 'BP_MEMBERS_SLUG', $bp->pages->members->slug );
     195        if ( !defined( 'BP_MEMBERS_SLUG' ) ) {
     196                if (!empty( $bp->pages->members->slug ) ) {
     197                        define( 'BP_MEMBERS_SLUG', $bp->pages->members->slug );
     198                } else {
     199                        define( 'BP_MEMBERS_SLUG', '' );
     200                }
     201        }
    185202
    186203        if ( !defined( 'BP_REGISTER_SLUG' ) )
    187                 define( 'BP_REGISTER_SLUG', $bp->pages->register->slug );
     204                if (!empty( $bp->pages->register->slug ) ) {
     205                        define( 'BP_REGISTER_SLUG', $bp->pages->register->slug );
     206                } else {
     207                        define( 'BP_REGISTER_SLUG', '' );
     208                }
    188209
    189210        if ( !defined( 'BP_ACTIVATION_SLUG' ) )
    190                 define( 'BP_ACTIVATION_SLUG', $bp->pages->activate->slug );
     211                if (!empty( $bp->pages->activate->slug ) ) {
     212                        define( 'BP_ACTIVATION_SLUG', $bp->pages->activate->slug );
     213                } else {
     214                        define( 'BP_ACTIVATION_SLUG', '');
     215                }
    191216}
    192217add_action( 'bp_setup_globals', 'bp_core_define_slugs' );
    193218
     
    960985                        if ( $bp->loggedin_user->id == $user_id )
    961986                                $ud = &$bp->loggedin_user->userdata;
    962987
    963                         if ( $bp->displayed_user->id == $user_id )
     988                        if ( !empty($bp->displayed_user->id) && $bp->displayed_user->id == $user_id )
    964989                                $ud = &$bp->displayed_user->userdata;
    965990
    966991                        if ( empty( $ud ) ) {
     
    12551280function bp_core_setup_message() {
    12561281        global $bp;
    12571282
    1258         if ( empty( $bp->template_message ) )
     1283        if ( empty( $bp->template_message ) && !empty( $_COOKIE['bp-message'] ) )
    12591284                $bp->template_message = $_COOKIE['bp-message'];
    12601285
    1261         if ( empty( $bp->template_message_type ) )
     1286        if ( empty( $bp->template_message_type ) && !empty( $_COOKIE['bp-message-type'] ) )
    12621287                $bp->template_message_type = $_COOKIE['bp-message-type'];
    12631288
    12641289        add_action( 'template_notices', 'bp_core_render_message' );
     
    18561881
    18571882function bp_core_add_ajax_hook() {
    18581883        /* Theme only, we already have the wp_ajax_ hook firing in wp-admin */
    1859         if ( !defined( 'WP_ADMIN' ) )
     1884        if ( !empty( $_REQUEST['action'] ) && !defined( 'WP_ADMIN' ) )
    18601885                do_action( 'wp_ajax_' . $_REQUEST['action'] );
    18611886}
    18621887add_action( 'init', 'bp_core_add_ajax_hook' );
  • bp-groups/bp-groups-filters.php

     
    6565        global $bp;
    6666
    6767        /* Only filter the forum SQL on group pages or on the forums directory */
    68         if ( ( $bp->groups->current_group && 'public' == $bp->groups->current_group->status ) || !$bp->groups->current_group ) {
     68        if ( empty( $bp->groups->current_group ) ) {
     69                return;
     70        }
     71        if ( 'public' == $bp->groups->current_group->status || !$bp->groups->current_group ) {
    6972                add_filter( 'get_topics_fields', 'groups_add_forum_fields_sql' );
    7073                add_filter( 'get_topics_index_hint', 'groups_add_forum_tables_sql' );
    7174                add_filter( 'get_topics_where', 'groups_add_forum_where_sql' );