Support » Plugin: BP Group Hierarchy » [Plugin: BP Group Hierarchy] Problems with "request-membership" requests

  • BP Group Hierarchy 1.2.7

    The “request membership” link wasn’t working for private subgroups in our installation. It would direct the user back to the group page with the “You do not have access to this group.” message. Here’s a diff of the one-liner that fixed it for me – but as usual I may have an insufficient understanding of the big picture:

    Index: bp-groups-hierarchy-component.php
    ===================================================================
    --- bp-groups-hierarchy-component.php	(revision 468709)
    +++ bp-groups-hierarchy-component.php	(working copy)
    @@ -110,7 +110,7 @@
     		}
    
     		// Group access control
    -		if ( bp_is_groups_component() && !empty( $this->current_group ) && !empty( $bp->current_action ) && !$this->current_group->user_has_access ) {
    +		if ( bp_is_groups_component() && !empty( $this->current_group ) && !empty( $bp->current_action ) && $bp->current_action != 'request-membership' && !$this->current_group->user_has_access ) {
     			if ( is_user_logged_in() ) {
     				// Off-limits to this user. Throw an error and redirect to the
     				// group's home page
    @@ -166,4 +166,4 @@
    
     }
    
    -?>
    \ No newline at end of file
    +?>

    That fixes it for regular users. As an admin the request membership links give me a 404. Still working on that one.

    http://wordpress.org/extend/plugins/bp-group-hierarchy/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author David Dean

    (@ddean)

    Thanks for catching this! I’m taking a look at it now.

    The one-liner you posted doesn’t reflect what’s in the stock Buddypress loader, so I’m thinking the “real” fix is somewhere else. But it’s a great start, and if you find anything else, please send it along. 🙂

    Plugin Author David Dean

    (@ddean)

    Hmm… looks like this may be a BP bug.

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

    I’ll see what I can do to replicate the fix. Have you noticed the issue with Hierarchy disabled?

    Yep – it does persist with Hierarchy disabled. Next maybe I’ll try that patch, and see if it Hierarchy will work without my hack. Thanks for checking it out!

    Plugin Author David Dean

    (@ddean)

    FWIW, the “Request Membership” BUTTON works just fine, but the link doesn’t. I tried this both with and without the patch, and it seems to be the same. Button works; link doesn’t.

    I’ll include your fix in the next release.

    You mean the link in the groups directory listing? On my dev site the button is just a styled link, and both seem to work with the fix. Odd, but very possible that another plugin is involved on my setup.

    Plugin Author David Dean

    (@ddean)

    I meant the tab on the group home page. You’re correct that they are all just styled links, and I apologize for being unclear.

    The links with a _wpnonce param all worked fine for me, while the “Request Membership” tab on the group home page did not.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: BP Group Hierarchy] Problems with "request-membership" requests’ is closed to new replies.