- First commit to issue fork.
- last update
about 1 year ago 29,382 pass, 1 fail - @rpayanm opened merge request.
- last update
about 1 year ago 29,383 pass
I believe this being a follow up to #2291055: REST resources for anonymous users: register → .
I am creating an user with the rest resource, configured not to verify email address, and the register_no_approval_required
is not sent.
However, registering the user with the same settings through the drupal UI as an anonymous user does send the notification.
One would expect the same behavior:
./core/modules/user/src/RegisterForm.php
// No email verification required; log in user immediately.
elseif (!$admin && !\Drupal::config('user.settings')->get('verify_mail') && $account->isActive()) {
_user_mail_notify('register_no_approval_required', $account);
user_login_finalize($account);
drupal_set_message($this->t('Registration successful. You are now logged in.'));
$form_state->setRedirect('<front>');
}
./core/modules/user/src/Plugin/rest/resource/UserRegistrationResource.php:
protected function sendEmailNotifications(UserInterface $account) {
$approval_settings = $this->userSettings->get('register');
// No e-mail verification is required. Activating the user.
if ($approval_settings == USER_REGISTER_VISITORS) {
if ($this->userSettings->get('verify_mail')) {
// No administrator approval required.
_user_mail_notify('register_no_approval_required', $account);
}
}
// Administrator approval required.
elseif ($approval_settings == USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL) {
_user_mail_notify('register_pending_approval', $account);
}
}
Needs work
10.1 ✨
Last updated
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.