diff --git a/core/lib/Drupal/Core/Form/FormValidator.php b/core/lib/Drupal/Core/Form/FormValidator.php index de9470a0fe..0674fc144f 100644 --- a/core/lib/Drupal/Core/Form/FormValidator.php +++ b/core/lib/Drupal/Core/Form/FormValidator.php @@ -335,7 +335,7 @@ protected function performRequiredValidation(&$elements, FormStateInterface &$fo } if (isset($elements['#options']) && isset($elements['#value'])) { - $error_message = 'The submitted value "%choice" in %name element is not allowed.'; + $error_message = 'The submitted value %choice in %name element is not allowed.'; $name = empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']; $message_arguments = ['%name' => $name]; if ($elements['#type'] == 'select') { diff --git a/core/modules/block/tests/src/FunctionalJavascript/BlockAddTest.php b/core/modules/block/tests/src/FunctionalJavascript/BlockAddTest.php index f3c09c00ea..96f8cdace5 100644 --- a/core/modules/block/tests/src/FunctionalJavascript/BlockAddTest.php +++ b/core/modules/block/tests/src/FunctionalJavascript/BlockAddTest.php @@ -44,7 +44,7 @@ public function testBlockAddThemeSelector() { // Switch to a theme that doesn't contain the region selected above. $assert_session->selectExists('Theme')->selectOption('stark'); $assert_session->assertWaitOnAjaxRequest(); - $assert_session->pageTextNotContains('The submitted value "Pre-content" in Region element is not allowed.'); + $assert_session->pageTextNotContains('The submitted value Pre-content in Region element is not allowed.'); $assert_session->optionExists('Region', '- Select -'); } diff --git a/core/modules/comment/tests/src/Functional/CommentFieldsTest.php b/core/modules/comment/tests/src/Functional/CommentFieldsTest.php index 4e2195d1a7..f00aec0894 100644 --- a/core/modules/comment/tests/src/Functional/CommentFieldsTest.php +++ b/core/modules/comment/tests/src/Functional/CommentFieldsTest.php @@ -165,7 +165,7 @@ public function testCommentFieldCreate() { $this->drupalGet('admin/config/people/accounts/fields/user.user.field_user_comment/storage'); $this->submitForm($edit, 'Save field settings'); // We should get an error message. - $this->assertSession()->pageTextContains('The submitted value "" in Comment type element is not allowed.'); + $this->assertSession()->pageTextContains('The submitted value in Comment type element is not allowed.'); // Create a comment type for users. $bundle = CommentType::create([ @@ -183,7 +183,7 @@ public function testCommentFieldCreate() { $this->drupalGet('admin/config/people/accounts/fields/user.user.field_user_comment/storage'); $this->submitForm($edit, 'Save field settings'); // We shouldn't get an error message. - $this->assertSession()->pageTextNotContains('The submitted value "" in Comment type element is not allowed.'); + $this->assertSession()->pageTextNotContains('The submitted value in Comment type element is not allowed.'); } /** diff --git a/core/modules/system/tests/src/Functional/Form/FormTest.php b/core/modules/system/tests/src/Functional/Form/FormTest.php index 0f084f5c37..2a37611483 100644 --- a/core/modules/system/tests/src/Functional/Form/FormTest.php +++ b/core/modules/system/tests/src/Functional/Form/FormTest.php @@ -886,7 +886,7 @@ public function testInputForgery() { // an input forgery. // @see \Drupal\form_test\Form\FormTestInputForgeryForm::postRender $this->submitForm(['checkboxes[one]' => TRUE, 'checkboxes[two]' => TRUE], 'Submit'); - $this->assertSession()->pageTextContains('The submitted value "FORGERY" in Checkboxes element is not allowed.'); + $this->assertSession()->pageTextContains('The submitted value FORGERY in Checkboxes element is not allowed.'); } /** diff --git a/core/modules/system/tests/src/Functional/Form/ValidationTest.php b/core/modules/system/tests/src/Functional/Form/ValidationTest.php index 3c2a38da22..137e3d11ba 100644 --- a/core/modules/system/tests/src/Functional/Form/ValidationTest.php +++ b/core/modules/system/tests/src/Functional/Form/ValidationTest.php @@ -235,7 +235,7 @@ public function testCustomRequiredError() { $this->assertSession()->pageTextContains((string) $form[$key]['#form_test_required_error']); } if (isset($form[$key]['#title'])) { - $this->assertSession()->pageTextNotContains('The submitted value "" in ' . $form[$key]['#title'] . ' element is not allowed.'); + $this->assertSession()->pageTextNotContains('The submitted value in ' . $form[$key]['#title'] . ' element is not allowed.'); } } @@ -258,7 +258,7 @@ public function testCustomRequiredError() { $this->assertSession()->pageTextNotContains((string) $form[$key]['#form_test_required_error']); } if (isset($form[$key]['#title'])) { - $this->assertSession()->pageTextNotContains('The submitted value "" in ' . $form[$key]['#title'] . ' element is not allowed.'); + $this->assertSession()->pageTextNotContains('The submitted value in ' . $form[$key]['#title'] . ' element is not allowed.'); } } } diff --git a/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php b/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php index 30bc014aab..0f5be03e3a 100644 --- a/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php +++ b/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php @@ -109,7 +109,7 @@ public function testExposedFormRenderCheckboxes() { // checked. $this->clickLink('Page 2'); $this->assertSession()->elementsCount('xpath', "//div[contains(@class, 'views-row')]", 1); - $this->assertSession()->pageTextNotContains('The submitted value "" in type element is not allowed.'); + $this->assertSession()->pageTextNotContains('The submitted value in type element is not allowed.'); } /** @@ -158,14 +158,14 @@ public function testExposedIsAllOfFilter() { // All rows are displayed by default on the first page when no options are // checked. $this->assertSession()->elementsCount('xpath', "//div[contains(@class, 'views-row')]", 8); - $this->assertSession()->pageTextNotContains('The submitted value "" in Reference Field element is not allowed.'); + $this->assertSession()->pageTextNotContains('The submitted value in Reference Field element is not allowed.'); // Select one option and ensure we still have results. $tid = $this->terms[0]->id(); $this->submitForm(["tid[$tid]" => $tid], 'Apply'); // Ensure only nodes tagged with $tid are displayed. $this->assertSession()->elementsCount('xpath', "//div[contains(@class, 'views-row')]", 2); - $this->assertSession()->pageTextNotContains('The submitted value "" in Reference Field element is not allowed.'); + $this->assertSession()->pageTextNotContains('The submitted value in Reference Field element is not allowed.'); } } diff --git a/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php b/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php index 5faa58b649..9252bc0d57 100644 --- a/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php +++ b/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php @@ -425,7 +425,7 @@ public function providerTestPerformRequiredValidation() { '#value' => 'baz', '#multiple' => FALSE, ], - new TranslatableMarkup('The submitted value "%choice" in %name element is not allowed.', ['%name' => 'Test', '%choice' => 'baz'], [], $this->getStringTranslationStub()), + new TranslatableMarkup('The submitted value %choice in %name element is not allowed.', ['%name' => 'Test', '%choice' => 'baz'], [], $this->getStringTranslationStub()), TRUE, ], [ @@ -438,7 +438,7 @@ public function providerTestPerformRequiredValidation() { '#value' => ['baz'], '#multiple' => TRUE, ], - new TranslatableMarkup('The submitted value "%choice" in %name element is not allowed.', ['%name' => 'Test', '%choice' => 0], [], $this->getStringTranslationStub()), + new TranslatableMarkup('The submitted value %choice in %name element is not allowed.', ['%name' => 'Test', '%choice' => 0], [], $this->getStringTranslationStub()), TRUE, ], [ @@ -451,7 +451,7 @@ public function providerTestPerformRequiredValidation() { '#value' => ['baz'], '#multiple' => TRUE, ], - new TranslatableMarkup('The submitted value "%choice" in %name element is not allowed.', ['%name' => 'Test', '%choice' => 'baz'], [], $this->getStringTranslationStub()), + new TranslatableMarkup('The submitted value %choice in %name element is not allowed.', ['%name' => 'Test', '%choice' => 'baz'], [], $this->getStringTranslationStub()), TRUE, ], [