Skip to:
Content

BuddyPress.org

Changeset 10237


Ignore:
Timestamp:
10/10/2015 06:50:10 PM (9 years ago)
Author:
djpaul
Message:

bp-legacy: fix nonce and message when requesting private group membership

The AJAX handler for the “request private group membership” button was
sending the wrong nonce in its response when you leave a private group.
The button refreshes its label to read “request membership” but as the
nonce was wrong, only “-1” was printed to the screen. Nothing actually
happened.

By coincidence, this is one of those legacy parts of BuddyPress where
markup is shared between a template file and inside an AJAX callback
function in the PHP. While resolving that duplication is beyond the
scope of this immediate change, the AJAX version of the template has
been updated to match the template file (the only change is the button
label).

Fixes #5790

Props lakrisgubben

Location:
trunk/src/bp-templates/bp-legacy
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r10184 r10237  
    14971497                    _e( 'Error requesting membership', 'buddypress' );
    14981498                } else {
    1499                     echo '<a id="group-' . esc_attr( $group->id ) . '" class="membership-requested" rel="membership-requested" title="' . __( 'Membership Requested', 'buddypress' ) . '" href="' . bp_get_group_permalink( $group ) . '">' . __( 'Membership Requested', 'buddypress' ) . '</a>';
     1499                    echo '<a id="group-' . esc_attr( $group->id ) . '" class="group-button disabled pending membership-requested" rel="membership-requested" title="' . __( 'Request Sent', 'buddypress' ) . '" href="' . bp_get_group_permalink( $group ) . '">' . __( 'Request Sent', 'buddypress' ) . '</a>';
    15001500                }
    15011501            }
     
    15101510            echo '<a id="group-' . esc_attr( $group->id ) . '" class="join-group" rel="join" title="' . __( 'Join Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ) . '">' . __( 'Join Group', 'buddypress' ) . '</a>';
    15111511        } elseif ( 'private' == $group->status ) {
    1512             echo '<a id="group-' . esc_attr( $group->id ) . '" class="request-membership" rel="join" title="' . __( 'Request Membership', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_send_membership_request' ) . '">' . __( 'Request Membership', 'buddypress' ) . '</a>';
     1512            echo '<a id="group-' . esc_attr( $group->id ) . '" class="request-membership" rel="join" title="' . __( 'Request Membership', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_request_membership' ) . '">' . __( 'Request Membership', 'buddypress' ) . '</a>';
    15131513        }
    15141514    }
  • trunk/src/bp-templates/bp-legacy/css/buddypress-rtl.css

    r10186 r10237  
    779779#buddypress input[type=reset],
    780780#buddypress ul.button-nav li a,
    781 #buddypress div.generic-button a,
     781#buddypress .generic-button a,
    782782#buddypress .comment-reply-link,
    783783a.bp-title-button {
  • trunk/src/bp-templates/bp-legacy/css/buddypress.css

    r10186 r10237  
    779779#buddypress input[type=reset],
    780780#buddypress ul.button-nav li a,
    781 #buddypress div.generic-button a,
     781#buddypress .generic-button a,
    782782#buddypress .comment-reply-link,
    783783a.bp-title-button {
Note: See TracChangeset for help on using the changeset viewer.