Hi Chad,
Thanks for the great plugin!
I was on 3.2.2.1 but still receiving the, “Sorry, username is a required field” error on attempted registration.
I worked out the cause. Leaving the fix here in case anyone has the same issue; at least they can benefit from the time I spent debugging it.
I was using the ‘wpmem_register_form_rows‘ filter to update the username field HTML in the registration form.
I was using:
add_filter( 'wpmem_register_form_rows', 'wpMembersChangeRegistrationRows', 10, 2);
function wpMembersChangeRegistrationRows( $rows, $tag ) {
if ($tag == 'new') {
$rows['username'] = array(
'order' => 3,
'row_before' => '',
'row_after' => '',
'field_before' => '',
'field_after' => '',
'field' => '<input name="user_login" type="text" id="user_login" value="" class="textbox" required="">',
'label' => '<label for="user_login" class="text">Username<span class="req">*</span></label>',
'type' => 'text',
);
}
return $rows;
}
I outputted $rows['username']
in this function and saw that the input now uses ‘username’ for the input name instead of ‘user_login’.
Updating this field name from ‘user_login’ to ‘username’ fixed it for me.
I’m guessing others may come across this if they are also overriding the username field and label with this filter.
Also, I still get the Uncaught TypeError: $(...).select2 is not a function
error in the main settings page: Settings > WP-Members Options.
I’m using the updated fix from this commit:
https://github.com/butlerblog/wp-members/commit/4d3bd820da356b027a88f87b1617a76057361f74
I installed a new WordPress site, and only added WP-Members and this JS error still occurs for me.
Cheers,
Nathan
-
This reply was modified 6 years, 7 months ago by
iugonathan.