Skip to content

Cannot create a new WP user for IS user when importing from event #320

@marekdedic

Description

@marekdedic

Specifically happens when the user doesn't have UserName and ParticipantEmail.

This code ejects:

if ( mb_strlen( $user['UserName'] ) === 0 ) {
return false;
}

and this code causes the empty data:

if ( isset( $participant->PersonEmail ) && ! empty( $participant->PersonEmail ) ) {
$emails = preg_split( '~(?=\,)~x', $participant->PersonEmail );
if ( ! empty( $emails ) && isset( $emails[0] ) ) {
$user->email = $emails[0];
}
} else {
$user->email = '';
}
$user->UserName = $user->email;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions