Merge pull request #13757 from snipe/fixes/RB-17334_user_formatted_array

Fixed RB-17334 - ErrorException: Undefined variable $user_formatted_array
This commit is contained in:
snipe 2023-10-17 22:34:52 +01:00 committed by GitHub
commit f2bc7d6173
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -281,9 +281,11 @@ abstract class Importer
$user_array['email'] = User::generateEmailFromFullName($user_array['full_name']);
}
// Get some variables for $user_formatted_array in case we need them later
$user_formatted_array = User::generateFormattedNameFromFullName($user_array['full_name'], Setting::getSettings()->username_format);
if (empty($user_array['first_name'])) {
// Get some fields for first name and last name based off of full name
$user_formatted_array = User::generateFormattedNameFromFullName($user_array['full_name'], Setting::getSettings()->username_format);
$user_array['first_name'] = $user_formatted_array['first_name'];
$user_array['last_name'] = $user_formatted_array['last_name'];
}