Commit dc2e4720 authored by catch's avatar catch
Browse files

Issue #1226044 by pgrond, martin107, roborn, rbayliss: The password_confirm...

Issue #1226044 by pgrond, martin107, roborn, rbayliss: The password_confirm element should not be aware of the user_form_process_password_confirm process.
parent 982ca4b5
...@@ -419,7 +419,7 @@ function system_element_info() { ...@@ -419,7 +419,7 @@ function system_element_info() {
); );
$types['password_confirm'] = array( $types['password_confirm'] = array(
'#input' => TRUE, '#input' => TRUE,
'#process' => array('form_process_password_confirm', 'user_form_process_password_confirm'), '#process' => array('form_process_password_confirm'),
'#theme_wrappers' => array('form_element'), '#theme_wrappers' => array('form_element'),
); );
$types['textarea'] = array( $types['textarea'] = array(
......
...@@ -99,6 +99,7 @@ public function form(array $form, array &$form_state) { ...@@ -99,6 +99,7 @@ public function form(array $form, array &$form_state) {
'#type' => 'password_confirm', '#type' => 'password_confirm',
'#size' => 25, '#size' => 25,
'#description' => $this->t('To change the current user password, enter the new password in both fields.'), '#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 // To skip the current password field, the user must have logged in via a
...@@ -146,6 +147,7 @@ public function form(array $form, array &$form_state) { ...@@ -146,6 +147,7 @@ public function form(array $form, array &$form_state) {
'#type' => 'password_confirm', '#type' => 'password_confirm',
'#size' => 25, '#size' => 25,
'#description' => $this->t('Provide a password for the new account in both fields.'), '#description' => $this->t('Provide a password for the new account in both fields.'),
'#pre_render' => array('user_form_pre_render_password_confirm'),
'#required' => TRUE, '#required' => TRUE,
); );
} }
......
...@@ -1699,13 +1699,10 @@ function _user_mail_notify($op, $account, $langcode = NULL) { ...@@ -1699,13 +1699,10 @@ function _user_mail_notify($op, $account, $langcode = NULL) {
/** /**
* Form element process handler for client-side password validation. * Form element process handler for client-side password validation.
* *
* This #process handler is automatically invoked for 'password_confirm' form * This #pre_render handler is added to the user registration form to add the
* elements to add the JavaScript and string translations for dynamic password * JavaScript and string translations for dynamic password validation.
* validation.
*
* @see system_element_info()
*/ */
function user_form_process_password_confirm($element) { function user_form_pre_render_password_confirm($element) {
$password_settings = array( $password_settings = array(
'confirmTitle' => t('Passwords match:'), 'confirmTitle' => t('Passwords match:'),
'confirmSuccess' => t('yes'), 'confirmSuccess' => t('yes'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment