[buddypress-trac] [BuddyPress Trac] #5357: 404 when clicking "Request Membership" within single group page

buddypress-trac noreply at wordpress.org
Thu Jan 30 01:29:22 UTC 2014


#5357: 404 when clicking "Request Membership" within single group page
-----------------------------------+--------------------
 Reporter:  mgibbs189              |       Owner:
     Type:  defect (bug)           |      Status:  new
 Priority:  low                    |   Milestone:  2.0
Component:  Groups                 |     Version:  1.9.1
 Severity:  minor                  |  Resolution:
 Keywords:  has-patch 2nd-opinion  |
-----------------------------------+--------------------
Changes (by imath):

 * keywords:  has-patch needs-testing => has-patch 2nd-opinion


Comment:

 So i've explored a bit more the issue. And i came to the conclusion that
 fixing it using javascript was not the best move.

 The main reason is that the mechanism that loads the group template is
 also acting as a fallback if javascript is disabled. So the fix will not
 completely solve the trouble.

 When on a single group, the "Request membership" button in group header
 acts like the subnav item having the same name. It loads the {{{bp-
 template/bp-legacy/buddypress/groups/request-membership.php}}}. With a
 regular user, there is no issue.

 Issue only occurs when a site Administrator is clicking on the button
 while the group is private. As, for this particular type of user the
 subnav is not set in group loader, the screen function is not run and
 finally the function bp_core_load_template() doesn't load the group's home
 template resulting in a 404.

 So i've built 2 patches :
 - Option 1 first adds a query arg into the button, when clicked a function
 is hooking {{{bp_actions}}} to process the membership requests.
 - Option 2 , that seemed the simple way at first.. is not so simple :) It
 consists in first removing {{{! bp_current_user_can( 'bp_moderate' )}}}
 check in the groups loader class to allow the request-membership subnav.
 Then, as each group is visible for a site administrator, it needs the
 {{{bp-template/bp-legacy/buddypress/groups/home.php}}} to be edited in
 order to include a new conditional statement to eventually load the
 request membership template. Then, having the request membership subnav is
 a bit annoying in this case so i've edited {{{bp_get_options_nav()}}} to
 remove it.

 Then, as i've played with the group members subnav of the group edit
 screen, i've noticed that a group Administrator was able to "kick & ban" a
 site Administrator. If we leave it this way, then a banned site
 Administrator will have a request membership button although he's already
 member.. So i think, we shouldn't let a group admin ban a site
 Administrator.. I've included a way to do so in both patches.

 I've chosed 2.0 milestone as it's not a regression from 1.9, it was
 already there in 1.8, and this is really a very particular case. On the
 other hand, the thread in the [http://buddypress.org/support/topic/404
 -error-on-request-membership-for-private-group-in-bp-1-8-1/ BuddyPress.org
 forum] began 5 months ago, so it can be interesting, if you think one of
 the 2 patches is ok, to add this in 1.9.2.

 What is your opinion ?

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5357#comment:3>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list