Commit 865c1b5e authored by eduardo morales alberti's avatar eduardo morales alberti Committed by Thomas Seidl
Browse files

Issue #3356817 by Eduardo Morales Alberti, drunken monkey: Adapted phrasing of...

Issue #3356817 by Eduardo Morales Alberti, drunken monkey: Adapted phrasing of warning in SearchApiFulltext to that of Core.
parent bbbc1f37
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
Search API 1.x, dev (xxxx-xx-xx):
---------------------------------
- #3356817 by Eduardo Morales Alberti, drunken monkey: Adapted phrasing of
  warning in SearchApiFulltext to that of Core.
- #3358661 by drunken monkey, tobiasb: Fixed coding standards.
- #3271256 by akalam, drunken monkey: Fixed infinite loop when indexing external
  entities.
+1 −2
Original line number Diff line number Diff line
@@ -359,8 +359,7 @@ class SearchApiFulltext extends FilterPluginBase {
      }
    }
    if (!$words) {
      $vars['@count'] = $this->options['min_length'];
      $msg = $this->t('You must include at least one positive keyword with @count characters or more.', $vars);
      $msg = $this->formatPlural($this->options['min_length'], '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.');
      $form_state->setErrorByName($identifier, $msg);
    }
    $input = implode(' ', $words);
+3 −3
Original line number Diff line number Diff line
@@ -106,13 +106,13 @@ class ViewsTest extends SearchApiBrowserTestBase {
    ];
    $label = 'Search for short word';
    $this->checkResults($query, [], $label);
    $this->assertSession()->pageTextContains('You must include at least one positive keyword with 3 characters or more');
    $this->assertSession()->pageTextContains('You must include at least one keyword to match in the content. Keywords must be at least 3 characters, and punctuation is ignored.');
    $query = [
      'search_api_fulltext' => 'foo to test',
    ];
    $label = 'Fulltext search including short word';
    $this->checkResults($query, [1, 2, 4], $label);
    $this->assertSession()->pageTextNotContains('You must include at least one positive keyword with 3 characters or more');
    $this->assertSession()->pageTextNotContains('You must include at least one keyword to match in the content. Keywords must be at least 3 characters, and punctuation is ignored.');

    $this->checkResults(['id[value]' => 2], [2], 'Search with ID filter');
    $query = [
@@ -436,7 +436,7 @@ class ViewsTest extends SearchApiBrowserTestBase {
      [],
      'Search for short word'
    );
    $this->assertSession()->pageTextContains('You must include at least one positive keyword with 3 characters or more');
    $this->assertSession()->pageTextContains('You must include at least one keyword to match in the content. Keywords must be at least 3 characters, and punctuation is ignored.');

    // Make sure this also works with the exposed form in a block, and doesn't
    // throw fatal errors on all pages with the block.