Unable to register users
-
I’m trying to troubleshoot my BuddyPress registration form, which seems to be having some serious problems. I should start by noting that I have added some customizations to my form to add additional data fields, but the registration fails regardless of whether the customizations and overrides are enabled or disabled, and fails in exactly the same manner based on the error log, so the customizations are unlikely to be having an impact.
Here are the hooks that I am using to track where the problem is originating from:
// Hook into various stages of the BuddyPress registration process
add_action( ‘bp_before_registration_submit_buttons’, ‘log_before_registration_submit_buttons’ );
add_action( ‘bp_core_screen_signup’, ‘log_core_screen_signup’ );
add_action( ‘bp_signup_pre_validate’, ‘log_signup_pre_validate’ );
add_action( ‘bp_signup_validate’, ‘ex_custom_bp_signup_validate’ );
add_action( ‘bp_core_signup_user’, ‘log_core_signup_user’, 10, 2 );
add_action( ‘bp_core_activate_user’, ‘log_core_activate_user’, 10, 3 );
add_filter( ‘bp_core_validate_user_signup’, ‘log_core_validate_user_signup’ );
add_filter( ‘bp_core_signup_user_notification’, ‘log_core_signup_user_notification’, 10, 2 );function log_before_registration_submit_buttons() {
error_log( ‘Hook: bp_before_registration_submit_buttons fired.’ );
}function log_core_screen_signup() {
error_log( ‘Hook: bp_core_screen_signup fired.’ );
error_log( ‘Form submission data: ‘ . print_r( $_POST, true ) );
}function log_signup_pre_validate() {
error_log( ‘Hook: bp_signup_pre_validate fired.’ );
}function ex_custom_bp_signup_validate() {
global $bp;
error_log( ‘bp_signup_validate hook fired. Validation errors: ‘ . print_r( $bp->signup->errors, true ) );
}function log_core_signup_user( $user_id, $user_data ) {
error_log( ‘Hook: bp_core_signup_user fired.’ );
error_log( ‘User ID: ‘ . $user_id );
error_log( ‘User Data: ‘ . print_r( $user_data, true ) );
}function log_core_activate_user( $user_id, $key, $user ) {
error_log( ‘Hook: bp_core_activate_user fired.’ );
error_log( ‘User ID: ‘ . $user_id );
error_log( ‘Activation Key: ‘ . $key );
error_log( ‘User Data: ‘ . print_r( $user, true ) );
}function log_core_validate_user_signup( $result ) {
error_log( ‘Hook: bp_core_validate_user_signup fired.’ );
error_log( ‘Validation Result: ‘ . print_r( $result, true ) );
return $result;
}function log_core_signup_user_notification( $user_id, $user_data ) {
error_log( ‘Hook: bp_core_signup_user_notification fired.’ );
error_log( ‘User ID: ‘ . $user_id );
error_log( ‘User Data: ‘ . print_r( $user_data, true ) );
return $user_data;
}Here is a sample of the outputs from testing, with and without the Extended Profiles setting turned on:
[19-Jul-2024 00:01:28 UTC] Hook: bp_core_screen_signup fired.
[19-Jul-2024 00:01:28 UTC] Form submission data: Array
(
[signup_username] => TestUserAlpha
[signup_email] => AlphaEmail@EmailAlpha.com
[signup_password] => xEO^ONJS1ZkY
[signup_password_confirm] => xEO^ONJS1ZkY
[field_1] => Imma User
[signup_profile_field_ids] => 1
[signup-privacy-policy-check] => 1
[signup-privacy-policy-accept] => on
[signup_submit] => Complete Sign Up
[_wpnonce] => 3184f10172
[_wp_http_referer] => /register
)[19-Jul-2024 00:01:28 UTC] Hook: bp_before_registration_submit_buttons fired.
[19-Jul-2024 00:01:32 UTC] Hook: bp_core_screen_signup fired.
[19-Jul-2024 00:01:32 UTC] Form submission data: Array
(
[signup_username] => TestUserBeta
[signup_email] => AlphaEmail@EmailAlpha.com
[signup_password] => oeHAfbtPlIRG
[signup_password_confirm] => oeHAfbtPlIRG
[signup-privacy-policy-check] => 1
[signup-privacy-policy-accept] => on
[signup_submit] => Complete Sign Up
[_wpnonce] => 9240fe3ccc
[_wp_http_referer] => /register
)After poking around in various threads and ChatGPT, the suggestion is that the error is happening in the form validation, and I was told to look at bp-core-signup.php in the bp-core folder. Problem: this file does not exist in my BuddyPress installation. I deleted everything, did a fresh installation, and the file still does not exist. I added the hooks back in, made another test, and got exactly the same result. So am I just straight up missing a file in my installation? Or is there a deeper problem that’s outside the scope of my current awareness?
- You must be logged in to reply to this topic.