Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291349

Status report confuses null email with duplicate email

$
0
0

Problem/Motivation

The status report now contains a check for duplicate email address and reports them with the heading "Conflicting user emails". However, accounts may be created without an email, i.e. with a NULL email, and these accounts incorrectly trigger the warning. Further, the drupal.org page linked to by the message contains a SQL query that does not return the NULL email messages, confusing the administrator as to which accounts are causing the warning.

Steps to reproduce

Create two different user accounts, both without an email address. View the status report and note the warning about conflicting user emails.

Proposed resolution

Exclude NULL email messages from the query that triggers the warning. In user.install, userRequirements():

  $query = \Drupal::database()->select('users_field_data');
  $query->addExpression('LOWER(mail)', 'lower_mail');
  $query->groupBy('lower_mail');
  $query->having('COUNT(uid) > :matches', [':matches' => 1]);
  $conflicts = $query->countQuery()->execute()->fetchField();

add

  $query->isNotNull('mail');

Viewing all articles
Browse latest Browse all 291349

Trending Articles