Issues/2980952: Update message on cancelling account with e-mail confirmation request.
2 unresolved threads
Closes #2980952
Merge request reports
Activity
149 148 $this->entity->user_cancel_notify = $form_state->getValue('user_cancel_notify'); 150 149 $this->entity->save(); 151 150 _user_mail_notify('cancel_confirm', $this->entity); 152 $this->messenger()->addStatus($this->t('A confirmation request to cancel your account has been sent to your email address.')); 153 151 $this->logger('user')->info('Sent account cancellation request to %name %email.', ['%name' => $this->entity->label(), '%email' => '<' . $this->entity->getEmail() . '>']); 154 152 153 $messenger = $this->messenger(); 154 if ($this->entity->id() == $this->currentUser()) { changed this line in version 3 of the diff
added 2167 commits
-
fe92079d...6dd918c9 - 2166 commits from branch
project:11.x
- 8997b2f8 - Merge branch '11.x' into 2980952-wrong-message-on
-
fe92079d...6dd918c9 - 2166 commits from branch
added 1 commit
- db6c9342 - Reverted the remaining changes to assertions
added 1 commit
- 80f90452 - Added a new test for the new admin cancellation message
149 149 $this->entity->user_cancel_notify = $form_state->getValue('user_cancel_notify'); 150 150 $this->entity->save(); 151 151 _user_mail_notify('cancel_confirm', $this->entity); 152 $this->messenger()->addStatus($this->t('A confirmation request to cancel your account has been sent to your email address.')); 153 152 $this->logger('user')->info('Sent account cancellation request to %name %email.', ['%name' => $this->entity->label(), '%email' => '<' . $this->entity->getEmail() . '>']); 154 153 154 $messenger = $this->messenger(); 155 if ($this->entity->id() == $this->currentUser()->id()) { 156 $messenger->addStatus($this->t('A confirmation request to cancel your account has been sent to your email address.')); 157 } 158 else { 159 $messenger->addStatus($this->t("A confirmation request to cancel the account %name has been sent to the user's email address.", ['%name' => $this->entity->label()])); 160 } - Comment on lines +154 to +160
any chance we can simplify? The action taken is the same in both branches of the condition, no need to duplicate it, just need to change the message in some cases.
151 $messenger = $this->messenger(); 152 if ($this->entity->id() == $this->currentUser()->id()) { 153 $messenger->addStatus($this->t('A confirmation request to cancel your account has been sent to your email address.')); 154 } 155 else { 156 $messenger->addStatus($this->t("A confirmation request to cancel the account %name has been sent to the user's email address.", ['%name' => $this->entity->label()])); 157 } 151 $cancel_message = $this->t('A confirmation request to cancel your account has been sent to your email address.'); 152 if ($this->entity->id() !== $this->currentUser()->id()) {{ 153 $cancel_message = $this->t("A confirmation request to cancel the account %name has been sent to the user's email address.", ['%name' => $this->entity->label()]); 154 } 155 $this->messenger()->addStatus($cancel_message); Edited by Théodore Biadala
added 168 commits
-
062623d9...d81484de - 167 commits from branch
project:11.x
- 4b7867a0 - Merge branch '11.x' into 2980952-wrong-message-on
-
062623d9...d81484de - 167 commits from branch
Please register or sign in to reply