Skip to content
Snippets Groups Projects

Issue #3481894: Error when trying to reset password of the account without email address.

Issue #3481894: Error when trying to reset password of the account without email address.

Closes #3481894

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
40 40 /**
41 41 * {@inheritdoc}
42 42 */
43 protected static $modules = ['block', 'language'];
43 protected static $modules = ['block', 'language', 'user'];
  • 205 '%email' => $account->getEmail(),
    206 ]);
    207 }
    208 }
    209 else {
    210 // Account exists and is active but has no email address
    201 211 $this->logger('user')
    202 ->info('Password reset instructions mailed to %name at %email.', [
    212 ->notice('Password reset form was submitted for account without email address: %name.', [
    203 213 '%name' => $account->getAccountName(),
    204 '%email' => $account->getEmail(),
    205 214 ]);
    206 215 }
    207 216 }
    208 217 else {
    218 // Account doesn't exist or is blocked
  • 208 }
    209 else {
    210 // Account exists and is active but has no email address
    201 211 $this->logger('user')
    202 ->info('Password reset instructions mailed to %name at %email.', [
    212 ->notice('Password reset form was submitted for account without email address: %name.', [
    203 213 '%name' => $account->getAccountName(),
    204 '%email' => $account->getEmail(),
    205 214 ]);
    206 215 }
    207 216 }
    208 217 else {
    218 // Account doesn't exist or is blocked
    209 219 $this->logger('user')
    210 ->info('Password reset form was submitted with an unknown or inactive account: %name.', [
    220 ->notice('Password reset form was submitted with an unknown or inactive account: %name.', [
  • 194 194 */
    195 195 public function submitForm(array &$form, FormStateInterface $form_state) {
    196 196 $account = $form_state->getValue('account');
    197 if ($account) {
    198 // Mail one time login URL and instructions using current language.
    199 $mail = _user_mail_notify('password_reset', $account);
    200 if (!empty($mail)) {
    197 if ($account && $account->isActive()) {
  • 198 if (!empty($account->get('mail')->value)) {
    199 // Mail one time login URL and instructions using current language.
    200 $mail = _user_mail_notify('password_reset', $account);
    201 if (!empty($mail)) {
    202 $this->logger('user')
    203 ->info('Password reset instructions mailed to %name at %email.', [
    204 '%name' => $account->getAccountName(),
    205 '%email' => $account->getEmail(),
    206 ]);
    207 }
    208 }
    209 else {
    210 // Account exists and is active but has no email address
    201 211 $this->logger('user')
    202 ->info('Password reset instructions mailed to %name at %email.', [
    212 ->notice('Password reset form was submitted for account without email address: %name.', [
  • Jan Kellermann added 1065 commits

    added 1065 commits

    Compare with previous version

  • Jatin Gupta added 7 commits

    added 7 commits

    Compare with previous version

  • Jatin Gupta added 1 commit

    added 1 commit

    Compare with previous version

  • Jatin Gupta added 1 commit

    added 1 commit

    Compare with previous version

  • Please register or sign in to reply
    Loading