diff --git a/core/lib/Drupal/Core/Form/FormValidator.php b/core/lib/Drupal/Core/Form/FormValidator.php index d7d70f3503..77515c10d1 100644 --- a/core/lib/Drupal/Core/Form/FormValidator.php +++ b/core/lib/Drupal/Core/Form/FormValidator.php @@ -345,7 +345,7 @@ protected function performRequiredValidation(&$elements, FormStateInterface &$fo $value = in_array($elements['#type'], ['checkboxes', 'tableselect']) ? array_keys($elements['#value']) : $elements['#value']; foreach ($value as $v) { if (!isset($options[$v])) { - $form_state->setError($elements, $this->t('An illegal choice has been detected. Please contact the site administrator.')); + $form_state->setError($elements, $this->t('An invalid choice has been detected. Please, contact the site administrator.')); $this->logger->error('Illegal choice %choice in %name element.', ['%choice' => $v, '%name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']]); } } @@ -364,7 +364,7 @@ protected function performRequiredValidation(&$elements, FormStateInterface &$fo $form_state->setValueForElement($elements, NULL); } elseif (!isset($options[$elements['#value']])) { - $form_state->setError($elements, $this->t('An illegal choice has been detected. Please contact the site administrator.')); + $form_state->setError($elements, $this->t('An invalid choice has been detected. Please, contact the site administrator.')); $this->logger->error('Illegal choice %choice in %name element.', ['%choice' => $elements['#value'], '%name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']]); } } diff --git a/core/modules/block/tests/src/FunctionalJavascript/BlockAddTest.php b/core/modules/block/tests/src/FunctionalJavascript/BlockAddTest.php index 17e020d8cc..9bfb24efe5 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('An illegal choice has been detected. Please contact the site administrator.'); + $assert_session->pageTextNotContains('An invalid choice has been detected. Please, contact the site administrator..'); $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 14b538bd4e..e691c3c641 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('An illegal choice has been detected. Please contact the site administrator.'); + $this->assertSession()->pageTextContains('An invalid choice has been detected. Please, contact the site administrator.'); // 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('An illegal choice has been detected. Please contact the site administrator.'); + $this->assertSession()->pageTextNotContains('An invalid choice has been detected. Please, contact the site administrator..'); } /** diff --git a/core/modules/system/tests/src/Functional/Form/FormTest.php b/core/modules/system/tests/src/Functional/Form/FormTest.php index 5599bf9dff..5ab77a4860 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('An illegal choice has been detected.'); + $this->assertSession()->pageTextContains('An invalid choice has been detected.'); } /** diff --git a/core/modules/system/tests/src/Functional/Form/ValidationTest.php b/core/modules/system/tests/src/Functional/Form/ValidationTest.php index 0738c34b23..c84e062cdb 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']); } } - $this->assertSession()->pageTextNotContains('An illegal choice has been detected. Please contact the site administrator.'); + $this->assertSession()->pageTextNotContains('An invalid choice has been detected. Please, contact the site administrator.'); // Verify that no custom validation error appears with valid values. $edit = [ @@ -256,7 +256,7 @@ public function testCustomRequiredError() { $this->assertSession()->pageTextNotContains((string) $form[$key]['#form_test_required_error']); } } - $this->assertSession()->pageTextNotContains('An illegal choice has been detected. Please contact the site administrator.'); + $this->assertSession()->pageTextNotContains('An invalid choice has been detected. Please, contact the site administrator.'); } } diff --git a/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php b/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php index e4b1b5417d..792a0fc71e 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('An illegal choice has been detected. Please contact the site administrator.'); + $this->assertSession()->pageTextNotContains('An invalid choice has been detected. Please, contact the site administrator.'); } /** @@ -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('An illegal choice has been detected. Please contact the site administrator.'); + $this->assertSession()->pageTextNotContains('An invalid choice has been detected. Please, contact the site administrator.'); // 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('An illegal choice has been detected. Please contact the site administrator.'); + $this->assertSession()->pageTextNotContains('An invalid choice has been detected. Please, contact the site administrator.'); } } diff --git a/core/modules/views/tests/src/Functional/Plugin/FilterTest.php b/core/modules/views/tests/src/Functional/Plugin/FilterTest.php index b153916439..8a4d74cdfd 100644 --- a/core/modules/views/tests/src/Functional/Plugin/FilterTest.php +++ b/core/modules/views/tests/src/Functional/Plugin/FilterTest.php @@ -173,7 +173,7 @@ public function testInOperatorSelectAllOptions() { $this->drupalGet('admin/structure/views/view/test_filter_in_operator_ui/edit/default'); $this->submitForm([], 'Save'); $this->submitForm([], 'Update preview'); - $this->assertSession()->pageTextNotContains('An illegal choice has been detected.'); + $this->assertSession()->pageTextNotContains('An invalid choice has been detected.'); } /** diff --git a/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php b/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php index eccceecc59..b3f324fe34 100644 --- a/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php +++ b/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php @@ -424,7 +424,7 @@ public function providerTestPerformRequiredValidation() { '#value' => 'baz', '#multiple' => FALSE, ], - 'An illegal choice has been detected. Please contact the site administrator.', + 'An invalid choice has been detected. Please, contact the site administrator.', TRUE, ], [ @@ -437,7 +437,7 @@ public function providerTestPerformRequiredValidation() { '#value' => ['baz'], '#multiple' => TRUE, ], - 'An illegal choice has been detected. Please contact the site administrator.', + 'An invalid choice has been detected. Please, contact the site administrator.', TRUE, ], [ @@ -450,7 +450,7 @@ public function providerTestPerformRequiredValidation() { '#value' => ['baz'], '#multiple' => TRUE, ], - 'An illegal choice has been detected. Please contact the site administrator.', + 'An invalid choice has been detected. Please, contact the site administrator.', TRUE, ], [