#4750 closed defect (bug) (wontfix)
groups_screen_group_request_membership action is not called when group membership is requested
Reported by: | rogercoathup | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 1.0 |
Component: | Groups | Keywords: | reporter-feedback |
Cc: |
Description
The do_action( 'groups_screen_group_request_membership' .. ) in the function groups_screen_group_request_membership() is in the wrong place in the code, and not called when group membership is requested:
It needs to be moved inside the if ( isset( $_POSTgroup-request-send? ) clause, and called before the bp_core_redirect().
Correct version of the function should be:
function groups_screen_group_request_membership() {
global $bp;
if ( !is_user_logged_in() )
return false;
$bp = buddypress();
if ( 'private' != $bp->groups->current_group->status )
return false;
If the user has submitted a request, send it.
if ( isset( $_POSTgroup-request-send?) ) {
Check the nonce
if ( !check_admin_referer( 'groups_request_membership' ) )
return false;
if ( !groups_send_membership_request( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
bp_core_add_message( ( 'There was an error sending your group membership request, please try again.', 'buddypress' ), 'error' );
} else {
bp_core_add_message( ( 'Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request.', 'buddypress' ) );
}
bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
}
do_action( 'groups_screen_group_request_membership', $bp->groups->current_group->id );
bp_core_load_template( apply_filters( 'groups_template_group_request_membership', 'groups/single/home' ) );
}
Change History (3)
#1
@
12 years ago
- Component changed from Core to Groups
- Keywords reporter-feedback added
- Version changed from 1.7 to 1.0
#2
@
12 years ago
- Resolution set to wontfix
- Status changed from new to closed
At any rate, we'd add a new action rather than remove or duplicate the existing one. And on that note, is the action in "groups_membership_requested" not good enough?
+1 to both points. Closing as wontfix because I think the tools are already there to do what you need. If you've got a use case where groups_membership_requested isn't good enough, please post details.
A lot of the screen functions have similar actions before the templates loaded. At any rate, we'd add a new action rather than remove or duplicate the existing one. And on that note, is the action in "groups_membership_requested" not good enough?