diff --git a/core/modules/node/src/Plugin/Search/NodeSearch.php b/core/modules/node/src/Plugin/Search/NodeSearch.php index 9dc4442ca2f0987072497d5bb014ae5f19a971c7..d787cb513f2929d2205cfd9187139865983d6176 100644 --- a/core/modules/node/src/Plugin/Search/NodeSearch.php +++ b/core/modules/node/src/Plugin/Search/NodeSearch.php @@ -293,7 +293,7 @@ protected function findResults() { } if ($status & SearchQuery::NO_POSITIVE_KEYWORDS) { - drupal_set_message($this->formatPlural($this->searchSettings->get('index.minimum_word_size'), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.'), 'warning'); + drupal_set_message($this->formatPlural($this->searchSettings->get('index.minimum_word_size'), 'You must include at least one keyword to match in the content, and punctuation is ignored.', 'You must include at least one keyword to match in the content. Keywords must be at least @count characters, and punctuation is ignored.'), 'warning'); } return $find; diff --git a/core/modules/search/src/Plugin/views/filter/Search.php b/core/modules/search/src/Plugin/views/filter/Search.php index d675a29abbaf6deb229085fefb8c23358bf83dd0..844a0b2cd20fb20402742c6fedfc202ee6162753 100644 --- a/core/modules/search/src/Plugin/views/filter/Search.php +++ b/core/modules/search/src/Plugin/views/filter/Search.php @@ -108,7 +108,7 @@ public function validateExposed(&$form, FormStateInterface $form_state) { if (!$form_state->isValueEmpty($key)) { $this->queryParseSearchExpression($form_state->getValue($key)); if (count($this->searchQuery->words()) == 0) { - $form_state->setErrorByName($key, $this->formatPlural(\Drupal::config('search.settings')->get('index.minimum_word_size'), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.')); + $form_state->setErrorByName($key, $this->formatPlural(\Drupal::config('search.settings')->get('index.minimum_word_size'), 'You must include at least one keyword to match in the content, and punctuation is ignored.', 'You must include at least one keyword to match in the content. Keywords must be at least @count characters, and punctuation is ignored.')); } } } diff --git a/core/modules/search/src/Tests/SearchBlockTest.php b/core/modules/search/src/Tests/SearchBlockTest.php index 4b774a122600a3010d7e07aab3c4281e1cd8d0a0..8351878e22acab8cd1f120ab22eb4c618c327f35 100644 --- a/core/modules/search/src/Tests/SearchBlockTest.php +++ b/core/modules/search/src/Tests/SearchBlockTest.php @@ -93,16 +93,16 @@ public function testSearchFormBlock() { // Test that after entering a too-short keyword in the form, you can then // search again with a longer keyword. First test using the block form. $this->submitGetForm('node', array('keys' => $this->randomMachineName(1)), t('Search')); - $this->assertText('You must include at least one positive keyword', 'Keyword message is displayed when searching for short word'); + $this->assertText('You must include at least one keyword to match in the content', 'Keyword message is displayed when searching for short word'); $this->assertNoText(t('Please enter some keywords'), 'With short word entered, no keywords message is not displayed'); $this->submitGetForm(NULL, array('keys' => $this->randomMachineName()), t('Search'), 'search-block-form'); - $this->assertNoText('You must include at least one positive keyword', 'Keyword message is not displayed when searching for long word after short word search'); + $this->assertNoText('You must include at least one keyword to match in the content', 'Keyword message is not displayed when searching for long word after short word search'); // Same test again, using the search page form for the second search this // time. $this->submitGetForm('node', array('keys' => $this->randomMachineName(1)), t('Search')); $this->drupalPostForm(NULL, array('keys' => $this->randomMachineName()), t('Search'), array(), array(), 'search-form'); - $this->assertNoText('You must include at least one positive keyword', 'Keyword message is not displayed when searching for long word after short word search'); + $this->assertNoText('You must include at least one keyword to match in the content', 'Keyword message is not displayed when searching for long word after short word search'); } diff --git a/core/modules/search/src/Tests/SearchNodePunctuationTest.php b/core/modules/search/src/Tests/SearchNodePunctuationTest.php index 23e95a4aebb773fc61176f9f0116e5f71de39a14..3c32997c4ba6f367e56332ee8d06986f17df67c5 100644 --- a/core/modules/search/src/Tests/SearchNodePunctuationTest.php +++ b/core/modules/search/src/Tests/SearchNodePunctuationTest.php @@ -57,11 +57,11 @@ function testPhraseSearchPunctuation() { $edit = array('keys' => '&'); $this->drupalPostForm('search/node', $edit, t('Search')); $this->assertNoRaw('<strong>&</strong>amp;'); - $this->assertText('You must include at least one positive keyword'); + $this->assertText('You must include at least one keyword'); $edit = array('keys' => '&'); $this->drupalPostForm('search/node', $edit, t('Search')); $this->assertNoRaw('<strong>&</strong>amp;'); - $this->assertText('You must include at least one positive keyword'); + $this->assertText('You must include at least one keyword'); } } diff --git a/core/modules/search/src/Tests/SearchPageTextTest.php b/core/modules/search/src/Tests/SearchPageTextTest.php index d973ffc5ed74381eb025a8ba13db9e2ad84c48e9..ad311d6f69e52bf48c155ab7cc584909635ccb1e 100644 --- a/core/modules/search/src/Tests/SearchPageTextTest.php +++ b/core/modules/search/src/Tests/SearchPageTextTest.php @@ -119,10 +119,10 @@ function testSearchText() { // message, and that if after that you search for a longer keyword, you // do not still see the message. $this->drupalPostForm('search/node', array('keys' => $this->randomMachineName(1)), t('Search')); - $this->assertText('You must include at least one positive keyword', 'Keyword message is displayed when searching for short word'); + $this->assertText('You must include at least one keyword', 'Keyword message is displayed when searching for short word'); $this->assertNoText(t('Please enter some keywords'), 'With short word entered, no keywords message is not displayed'); $this->drupalPostForm(NULL, array('keys' => $this->randomMachineName()), t('Search')); - $this->assertNoText('You must include at least one positive keyword', 'Keyword message is not displayed when searching for long word after short word search'); + $this->assertNoText('You must include at least one keyword', 'Keyword message is not displayed when searching for long word after short word search'); // Test that if you search for a URL with .. in it, you still end up at // the search page. See issue https://www.drupal.org/node/890058.