Skip to:
Content
Pages
Categories
Search
Top
Bottom

Changing group home page causes infinite loop in private groups


  • 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)

  • raphadko
    Participant

    @raphadko

    bump..


    raphadko
    Participant

    @raphadko

    bump.


    raphadko
    Participant

    @raphadko

    So, should I submit this as a bug ticket?


    dennissmolek
    Participant

    @dennissmolek

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

    https://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.


    modemlooper
    Moderator

    @modemlooper

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


    modemlooper
    Moderator

    @modemlooper

    Or, if group is private and user is not member


    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


    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’ );


    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’ );

    }


    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 ?


    Clementkjhjkh
    Participant

    @clementkjhjkh

    Does someone know where is the problem ?
    Thanks


    Clementkjhjkh
    Participant

    @clementkjhjkh

    Anyone ? Please…

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Changing group home page causes infinite loop in private groups’ is closed to new replies.
Skip to toolbar