Skip to:
Content
Pages
Categories
Search
Top
Bottom

Changing group home page causes infinite loop in private groups

  • Avatar of raphadko
    raphadko
    Participant

    @raphadko

    Ok, so I have customized my theme to run the forums page in the groups home using the following line in bp-custom.php:

    define( ‘BP_GROUPS_DEFAULT_EXTENSION’, ‘forum’ );

    Now every private group gets an infinite redirection loop for users that are not members. How do I fix this?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Avatar of raphadko
    raphadko
    Participant

    @raphadko

    bump..

    Avatar of raphadko
    raphadko
    Participant

    @raphadko

    bump.

    Avatar of raphadko
    raphadko
    Participant

    @raphadko

    So, should I submit this as a bug ticket?

    Avatar of dennissmolek
    dennissmolek
    Participant

    @dennissmolek

    I am having the exact same problem. I submitted it as a ticket:

    http://buddypress.trac.wordpress.org/ticket/4706

    What is happening is its trying to redirect to the home tab, then the change default filter moves it to the other tab, which causes the loop.

     

    Until its fixed simply add ‘/home’ to the line mentioned in the ticket.

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    Just wrap that define with code that tests if a user is a member of group.

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    Or, if group is private and user is not member

    Avatar of Clementkjhjkh
    Clementkjhjkh
    Participant

    @clementkjhjkh

    Hi,
    I have the same problem, i tried this :

    but it doesn’t work, am i doing something wrong ?
    Besides i got a warning message :

    Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /homez.38/centrale/www/demo/demo/INELSE/wp-content/plugins/bp-custom.php:10) in /homez.38/centrale/www/demo/demo/INELSE/wp-content/plugins/events-manager/classes/em-notices.php on line 11

    If someone has a solution, it would be really great

    Avatar of Clementkjhjkh
    Clementkjhjkh
    Participant

    @clementkjhjkh

    Sorry, here is what i tried :

    function redirect_to_forum() {
    global $bp;
    if( bp_is_group_members() )
    define(‘BP_GROUPS_DEFAULT_EXTENSION’, ‘forum’ );
    }
    add_action( ‘wp’, ‘redirect_to_forum’ );

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    This is not tested but you don’t want the define to run if a member is not a member of a private group.

    if ( bp_group_is_visible  &&  bp_is_group_member() ) {

    define(‘BP_GROUPS_DEFAULT_EXTENSION’, ‘forum’ );

    }

    Avatar of Clementkjhjkh
    Clementkjhjkh
    Participant

    @clementkjhjkh

    Thanks,
    Actually i think that your code should work and that my problem may be not where i thought. problem.
    When i use
    define(‘BP_GROUPS_DEFAULT_EXTENSION’, ‘forum’ );
    it works but when i put it in a function like that, nothing happens:

    function redirect_to_forum(){
    define('BP_GROUPS_DEFAULT_EXTENSION', 'forum' );
    }
    add_action('wp','redirect_to_forum');

    So, i think that’s why nothing happens when i try to add your code.
    Do you know what’s wrong with my function ?

    Avatar of Clementkjhjkh
    Clementkjhjkh
    Participant

    @clementkjhjkh

    Does someone know where is the problem ?
    Thanks

    Avatar of Clementkjhjkh
    Clementkjhjkh
    Participant

    @clementkjhjkh

    Anyone ? Please…

Viewing 12 replies - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.