Mike (@mfkelly)

Forum Replies Created

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

  • Mike
    Participant

    @mfkelly

    I’m having a problem with this still, in bbpress 2.5.3, WordPress 3.9.1, Buddypress 2.0.1

    In a public forum associated with a site, logged-in Buddpyress users who are not a member of that individual site get a 404 error because they don’t have ‘spectate’ privileges.
    Is that expected behaviour?
    N.B. I have tweaked things so that visiting users are *not* automatically set up with a site role. I only give them bbp_participant status if they already have a role in the blog site. Is that the issue?

    In debugging, I notice that in bbpress/includes/users/capabilities.php the visiting bbpress user who is not a member of the site is mapped a list of capabilities, including ‘specate’. However, in bbp_forum_enforce_blocked, the capabilities of the WordPress user are checked for spectate, not the bbp user. Hence the 404. If I check for the bbp user’s capabilities inside bbp_forum_enforce_blocked, they have been reset in any case.

    Can anyone give guidance on this? Thanks.


    Mike
    Participant

    @mfkelly

    This turned out to be a clash with the admin-message plugin (wpmudev.org).
    If I comment out the include_once statement at the very bottom of admin-message.php, which pulls in all the spammy advertising stuff WPMU put into your admin pages, the forum menus reappear.

    As this issue seems to occur with quite a few plugins, it might be useful to draw up a list of plugins which cause compatibility issues with bbPress.

    If you know of any please comment in this thread.


    Mike
    Participant

    @mfkelly

    I added a simple check in bbpress/inlcudes/users/capabilities.php to see whether the current user has a role in the current blog, before giving them a forum role:

    	/** Ready *****************************************************************/
    
    	// Load up bbPress once
    	$bbp         = bbpress();
    
    	// Get whether or not to add a role to the user account
    	$blog_role = bbp_get_user_blog_role( $user_id );
    	$add_to_site = bbp_allow_global_access() && $blog_role != false;
    

    With that in place I can reset all my previous changes so that the default setting for global access is true.
    I’ve edited the text in Forums -> Settings to show that ‘global access’ is really now just ‘site access’.

    Ideally this would be a separate option in Forums -> Settings, to limit automatic forum access to site members. I will submit a patch if I get the time.

    The problem with the default settings is that in a large Buddypress-type site, every time I visit a new site when logged in, that site is added to my My Sites list.


    Mike
    Participant

    @mfkelly

    OK, thanks.
    Any thoughts on giving the site users bbPress roles automatically, rather than the network users?
    And on running:
    Tools -> Forums -> Repair Forums -> Remap existing users to default forum roles
    for all blogs too?


    Mike
    Participant

    @mfkelly

    I think what is required in this context is an option to automatically assign forum roles to registered blog users, but not registered network users, as is currently the case.


    Mike
    Participant

    @mfkelly

    Well I set the default value for ‘allow global access’ to false in the options file:

    function bbp_allow_global_access( $default = 0 ) {
    	return (bool) apply_filters( 'bbp_allow_global_access', (bool) get_option( '_bbp_allow_global_access', $default ) );
    }

    Hopefully that together with my other changes will have done the trick.

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