Skip to content
Snippets Groups Projects
Commit c8e2c3f1 authored by JediKev's avatar JediKev
Browse files

issue: User Import No Email

This addresses issue 4329 where you can import a User with no email
address via CSV file. Once the User is added and you try to update them
with an email address it fails due to no default email. This updates the
check for email address from `!isset()` to `empty()` which will correctly
check for empty string.
parent 43bf186d
No related branches found
No related tags found
No related merge requests found
......@@ -452,7 +452,7 @@ implements TemplateVariable {
db_autocommit(false);
$records = $importer->importCsv(UserForm::getUserForm()->getFields(), $defaults);
foreach ($records as $data) {
if (!isset($data['email']) || !isset($data['name']))
if (!Validator::is_email($data['email']) || empty($data['name']))
throw new ImportError('Both `name` and `email` fields are required');
if (!($user = static::fromVars($data, true, true)))
throw new ImportError(sprintf(__('Unable to import user: %s'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment