diff --git a/core/modules/user/src/AccountForm.php b/core/modules/user/src/AccountForm.php index e86e980..0965e20 100644 --- a/core/modules/user/src/AccountForm.php +++ b/core/modules/user/src/AccountForm.php @@ -351,7 +351,7 @@ public function validate(array $form, FormStateInterface $form_state) { // Check whether the user name provided is an email address, if so, make // sure it matches the mail value. if (\Drupal::config('user.settings')->get('verify_email_match') && (filter_var($name, FILTER_VALIDATE_EMAIL) && ($name !== $mail))) { - $this->setFormError('name', $form_state, $this->t('You have provided an email address as a username, but this does not match your email address.')); + $form_state->setErrorByName('name', $this->t('You have provided an email address as a username, but this does not match your email address.')); } } }