diff --git a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php index c8fdd19..5847874 100644 --- a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php +++ b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php @@ -147,12 +147,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#type' => 'fieldgroup', '#title' => $this->t('Site maintenance account'), ); - $form['admin_account']['account']['#tree'] = TRUE; - $form['admin_account']['account']['mail'] = array( - '#type' => 'email', - '#title' => $this->t('Email address'), - '#required' => TRUE, - ); $form['admin_account']['account']['name'] = array( '#type' => 'textfield', '#title' => $this->t('Username'), @@ -166,7 +160,13 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#required' => TRUE, '#size' => 25, ); - + $form['admin_account']['account']['#tree'] = TRUE; + $form['admin_account']['account']['mail'] = array( + '#type' => 'email', + '#title' => $this->t('Email address'), + '#required' => TRUE, + ); + $form['regional_settings'] = array( '#type' => 'fieldgroup', '#title' => $this->t('Regional settings'), diff --git a/core/modules/user/src/Tests/UserAccountFormFieldsTest.php b/core/modules/user/src/Tests/UserAccountFormFieldsTest.php index e880429..e242a07 100644 --- a/core/modules/user/src/Tests/UserAccountFormFieldsTest.php +++ b/core/modules/user/src/Tests/UserAccountFormFieldsTest.php @@ -42,7 +42,7 @@ function testInstallConfigureForm() { // Verify that web browsers may autocomplete the email value and // autofill/prefill the name and pass values. - foreach (array('name', 'mail', 'pass') as $key) { + foreach (array('mail', 'name', 'pass') as $key) { $this->assertFalse(isset($form['account'][$key]['#attributes']['autocomplete']), "'$key' field: 'autocomplete' attribute not found."); } } @@ -67,7 +67,7 @@ function testUserRegistrationForm() { // Verify that web browsers may autocomplete the email value and // autofill/prefill the name and pass values. - foreach (array('name', 'mail', 'pass') as $key) { + foreach (array('mail', 'name', 'pass') as $key) { $this->assertFalse(isset($form['account'][$key]['#attributes']['autocomplete']), "'$key' field: 'autocomplete' attribute not found."); } } @@ -89,7 +89,7 @@ function testUserEditForm() { $this->assertFieldOrder($form['account']); // Verify that autocomplete is off on all account fields. - foreach (array('name', 'mail', 'pass') as $key) { + foreach (array('mail', 'name', 'pass') as $key) { $this->assertIdentical($form['account'][$key]['#attributes']['autocomplete'], 'off', "'$key' field: 'autocomplete' attribute is 'off'."); } } @@ -119,7 +119,7 @@ protected function assertFieldOrder(array $elements) { } $index++; } - $this->assertTrue($name_index < $pass_index, "'name' field ($name_index) appears before 'pass' field ($pass_index)."); + $this->assertEqual($name_index, $pass_index - 1, "'name' field ($name_index) appears before 'pass' field ($pass_index)."); $this->assertTrue($name_weight < $pass_weight, "'name' field weight ($name_weight) is smaller than 'pass' field weight ($pass_weight)."); }