diff -u b/core/modules/user/src/AccountForm.php b/core/modules/user/src/AccountForm.php --- b/core/modules/user/src/AccountForm.php +++ b/core/modules/user/src/AccountForm.php @@ -16,7 +16,6 @@ use Drupal\user\Plugin\LanguageNegotiation\LanguageNegotiationUser; use Drupal\user\Plugin\LanguageNegotiation\LanguageNegotiationUserAdmin; use Symfony\Component\DependencyInjection\ContainerInterface; -// use Drupal\Core\Messenger\Messenger; use Drupal\Core\Messenger\MessengerInterface; /** @@ -35,7 +34,7 @@ * The Message service. * * @var \Drupal\Core\Language\LanguageManagerInterface - */ + */ protected $messenger; @@ -50,11 +49,13 @@ * The entity type bundle service. * @param \Drupal\Component\Datetime\TimeInterface $time * The time service. + * @param \Drupal\Core\Messenger\MessengerInterface $messengerManager + * The messenger Manager. */ - public function __construct(EntityRepositoryInterface $entity_repository, LanguageManagerInterface $language_manager, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, TimeInterface $time = NULL,MessengerInterface $messengerManager) { + public function __construct(EntityRepositoryInterface $entity_repository, LanguageManagerInterface $language_manager, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, TimeInterface $time = NULL, MessengerInterface $messengerManager) { parent::__construct($entity_repository, $entity_type_bundle_info, $time); $this->languageManager = $language_manager; - $this->messenger = $messengerManager; + $this->messenger = $messengerManager; } /** @@ -176,7 +177,7 @@ } } } - elseif (!$config->get('verify_mail') || $admin_create) { + elseif (!$config->get('verify_mail') || $config->get('register_password_set') || $admin_create) { $form['account']['pass'] = [ '#type' => 'password_confirm', '#size' => 25,