diff --git a/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php index a0bfa758875694c58602d6eefee48468d362919c..4b8bfaca024fd28105951f79c3f580c9ecc22416 100644 --- a/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php @@ -179,11 +179,11 @@ public function testStringTranslation() { // Test invalidation of 'rendered' cache tag after string translation. $this->drupalLogout(); $this->drupalGet('xx/user/login'); - $this->assertSession()->pageTextContains('Enter the password that accompanies your username.'); + $this->assertSession()->pageTextContains('Password'); $this->drupalLogin($translate_user); $search = [ - 'string' => 'accompanies your username', + 'string' => 'Password', 'langcode' => $langcode, 'translation' => 'untranslated', ]; @@ -192,14 +192,14 @@ public function testStringTranslation() { $textarea = $this->assertSession()->elementExists('xpath', '//textarea'); $lid = $textarea->getAttribute('name'); $edit = [ - $lid => 'Enter your Llama username.', + $lid => 'Llamas are larger than frogs.', ]; $this->drupalGet('admin/config/regional/translate'); $this->submitForm($edit, 'Save translations'); $this->drupalLogout(); $this->drupalGet('xx/user/login'); - $this->assertSession()->pageTextContains('Enter your Llama username.'); + $this->assertSession()->pageTextContains('Llamas are larger than frogs.'); // Delete the language. $this->drupalLogin($admin_user); diff --git a/core/modules/user/src/Form/UserLoginForm.php b/core/modules/user/src/Form/UserLoginForm.php index bf1357007a12518b6acdfe6c7aec31772dba9b32..cdbcfa7c4e7b2b14042cf23717ead9e1b4230da1 100644 --- a/core/modules/user/src/Form/UserLoginForm.php +++ b/core/modules/user/src/Form/UserLoginForm.php @@ -109,7 +109,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#title' => $this->t('Username'), '#size' => 60, '#maxlength' => UserInterface::USERNAME_MAX_LENGTH, - '#description' => $this->t('Enter your @s username.', ['@s' => $config->get('name')]), '#required' => TRUE, '#attributes' => [ 'autocorrect' => 'none', @@ -123,7 +122,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#type' => 'password', '#title' => $this->t('Password'), '#size' => 60, - '#description' => $this->t('Enter the password that accompanies your username.'), '#required' => TRUE, ]; diff --git a/core/modules/user/src/Plugin/Block/UserLoginBlock.php b/core/modules/user/src/Plugin/Block/UserLoginBlock.php index f55a70d6118f6c9e85d3384d0182cdd3de508b74..ccd239b96ec6ba3ea63e5db4ce8a0d0e80c0c6fc 100644 --- a/core/modules/user/src/Plugin/Block/UserLoginBlock.php +++ b/core/modules/user/src/Plugin/Block/UserLoginBlock.php @@ -85,13 +85,6 @@ protected function blockAccess(AccountInterface $account) { public function build() { $form = \Drupal::formBuilder()->getForm('Drupal\user\Form\UserLoginForm'); unset($form['name']['#attributes']['autofocus']); - // When unsetting field descriptions, also unset aria-describedby attributes - // to avoid introducing an accessibility bug. - // @todo Do this automatically in https://www.drupal.org/node/2547063. - unset($form['name']['#description']); - unset($form['name']['#attributes']['aria-describedby']); - unset($form['pass']['#description']); - unset($form['pass']['#attributes']['aria-describedby']); $form['name']['#size'] = 15; $form['pass']['#size'] = 15;