diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 83cc650f201f4a34036f63c3622afa95a38ab430..f9ae056b30b0d13f1531184e1709a38648aa1198 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -419,7 +419,7 @@ function system_element_info() { ); $types['password_confirm'] = array( '#input' => TRUE, - '#process' => array('form_process_password_confirm'), + '#process' => array('form_process_password_confirm', 'user_form_process_password_confirm'), '#theme_wrappers' => array('form_element'), ); $types['textarea'] = array( diff --git a/core/modules/user/lib/Drupal/user/AccountFormController.php b/core/modules/user/lib/Drupal/user/AccountFormController.php index eca2eb29d48f238522d106584c6cf2f23ab7cc13..4983b0f0bedda8936ce76fc6c7c4e7d52691a462 100644 --- a/core/modules/user/lib/Drupal/user/AccountFormController.php +++ b/core/modules/user/lib/Drupal/user/AccountFormController.php @@ -99,7 +99,6 @@ public function form(array $form, array &$form_state) { '#type' => 'password_confirm', '#size' => 25, '#description' => $this->t('To change the current user password, enter the new password in both fields.'), - '#pre_render' => array('user_form_pre_render_password_confirm'), ); // To skip the current password field, the user must have logged in via a @@ -147,7 +146,6 @@ public function form(array $form, array &$form_state) { '#type' => 'password_confirm', '#size' => 25, '#description' => $this->t('Provide a password for the new account in both fields.'), - '#pre_render' => array('user_form_pre_render_password_confirm'), '#required' => TRUE, ); } diff --git a/core/modules/user/user.module b/core/modules/user/user.module index f551063c517324d767c1bfdef8ba64d38b937514..f6a30cbde5da6362325710f3839a5f814c2d16c4 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -1699,10 +1699,13 @@ function _user_mail_notify($op, $account, $langcode = NULL) { /** * Form element process handler for client-side password validation. * - * This #pre_render handler is added to the user registration form to add the - * JavaScript and string translations for dynamic password validation. + * This #process handler is automatically invoked for 'password_confirm' form + * elements to add the JavaScript and string translations for dynamic password + * validation. + * + * @see system_element_info() */ -function user_form_pre_render_password_confirm($element) { +function user_form_process_password_confirm($element) { $password_settings = array( 'confirmTitle' => t('Passwords match:'), 'confirmSuccess' => t('yes'),