Issue #3481894: Error when trying to reset password of the account without email address.
5 open threads
Closes #3481894
Merge request reports
Activity
40 40 /** 41 41 * {@inheritdoc} 42 42 */ 43 protected static $modules = ['block', 'language']; 43 protected static $modules = ['block', 'language', 'user']; changed this line in version 5 of the diff
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 changed this line in version 4 of the diff
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.', [ changed this line in version 4 of the diff
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()) { changed this line in version 4 of the diff
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.', [ changed this line in version 4 of the diff
added 1065 commits
-
e20a36b7...71cc5fd8 - 1064 commits from branch
project:11.x
- fa18f9f7 - Merge branch drupal:11.x into 3481894-error-when-trying
-
e20a36b7...71cc5fd8 - 1064 commits from branch
added 7 commits
-
fa18f9f7...f1646309 - 4 commits from branch
project:11.x
- b4fd3a94 - Issue #3481894: Error when trying to reset password of the account without email address.
- 93e87de9 - Issue #3481894: Made changes and add test.
- 9ce690f0 - Issue #3481894: Error when trying to reset password of the account without email address
Toggle commit list-
fa18f9f7...f1646309 - 4 commits from branch
Please register or sign in to reply