diff --git a/core/lib/Drupal/Core/Render/Element/PasswordReveal.php b/core/lib/Drupal/Core/Render/Element/PasswordReveal.php index 57fe9b9..5124194 100644 --- a/core/lib/Drupal/Core/Render/Element/PasswordReveal.php +++ b/core/lib/Drupal/Core/Render/Element/PasswordReveal.php @@ -34,7 +34,7 @@ class PasswordReveal extends Password { */ public function getInfo() { $info = parent::getInfo(); - $info['#process'][] = [get_class($this), 'processPasswordReveal']; + $info['#process'][] = [static::class, 'processPasswordReveal']; return $info; } @@ -43,9 +43,9 @@ public function getInfo() { * Adds the attributes needed to add password strength and the reveal button. */ public static function processPasswordReveal(&$element, FormStateInterface $form_state, &$complete_form) { + $element['#attached']['library'][] = 'core/drupal.revealpass'; $element['#attributes']['class'][] = 'password-field'; $element['#attributes']['class'][] = 'js-password-field'; - $element['#attached']['library'][] = 'core/drupal.revealpass'; $element['#attributes']['data-drupal-revealpass'] = TRUE; $element['#attributes']['data-drupal-password-strength'] = TRUE; diff --git a/core/modules/user/user.install b/core/modules/user/user.install index 7cc46ef..6cb2b7c 100644 --- a/core/modules/user/user.install +++ b/core/modules/user/user.install @@ -105,5 +105,12 @@ function user_update_8100() { } /** + * Add the configuration setting for password_type_reveal. + */ +function user_update_8101() { + \Drupal::configFactory()->getEditable('user.settings')->set('password_type_reveal', FALSE)->save(); +} + +/** * @} End of "addtogroup updates-8.1.0-beta". */