BP Group Hierarchy
Problems with "request-membership" requests (7 posts)

  1. Dylan Kuhn
    Posted 4 years ago #

    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.


  2. David Dean
    Plugin Author

    Posted 4 years ago #

    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. :)

  3. David Dean
    Plugin Author

    Posted 4 years ago #

    Hmm... looks like this may be a BP bug.


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

  4. Dylan Kuhn
    Posted 4 years ago #

    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!

  5. David Dean
    Plugin Author

    Posted 4 years ago #

    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.

  6. Dylan Kuhn
    Posted 4 years ago #

    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.

  7. David Dean
    Plugin Author

    Posted 4 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • BP Group Hierarchy
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic