Skip to content

Commit

Permalink
Issue #74: Better messaging for user account imports. (#75) by @jenla…
Browse files Browse the repository at this point in the history
  • Loading branch information
jenlampton authored Jan 7, 2021
1 parent 6215f42 commit e739ea6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions plugins/FeedsUserProcessor.inc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class FeedsUserProcessor extends FeedsProcessor {
*/
protected function entityInfo() {
$info = parent::entityInfo();
$info['label plural'] = t('Users');
$info['label plural'] = t('User Accounts');
return $info;
}

Expand Down Expand Up @@ -101,8 +101,11 @@ class FeedsUserProcessor extends FeedsProcessor {
*/
protected function entityValidate($account, FeedsSource $source = NULL) {
parent::entityValidate($account);
if (empty($account->name) || empty($account->mail) || !valid_email_address($account->mail)) {
throw new FeedsValidationException(t('User name missing or email not valid.'));
if (empty($account->name) || empty($account->mail)) {
throw new FeedsValidationException(t('User name or email missing.'));
}
if (!valid_email_address(trim($account->mail))) {
throw new FeedsValidationException(t('Email not valid.'));
}

// Check when an user ID gets set or changed during processing if that user
Expand Down

0 comments on commit e739ea6

Please sign in to comment.