Validation of 3 minimum_word_size for search exposed filters only show the warning once

Created on 26 February 2016, over 8 years ago
Updated 12 July 2023, over 1 year ago

Problem/Motivation

There is an inconsistence between the behaviour of the message: You must include at least one keyword to match in the content. Keywords must be at least 3 characters, and punctuation is ignored. provided by the search/node UI and the use of exposed filters.

When using the search/node UI if the user types less that 3 characters the message is displayed everytime the user submit the form.

When using views with a search exposed filter, if the user sends less than 3 characters it see the warning only the first time, then the message disappears.

Proposed resolution

Seem the problem is related to the use of $form_state->setErrorByName on the views plugin and drupal_set_message(..., 'warning') on the node/src/Plugin/Search/NodeSearch.php

πŸ› Bug report
Status

Active

Version

10.1 ✨

Component
SearchΒ  β†’

Last updated 9 days ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @pwolanin
Created by

πŸ‡¦πŸ‡·Argentina dagmar Argentina

Live updates comments and jobs are added and updated live.
  • VDC

    Related to the Views in Drupal Core initiative.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    @dagmar Thank you for reporting this problem. We rely on issue reports like this to improve Drupal core.

    I tested this on 10.1.x, standard install. I created content with devel_generate. Then I duplicated the content view. I added a search filter to the view and tested that view. I entered a two letter string and received the error message. I changed the two letter string and filtered again. I received the error message. I then entered a three letter string, click filter and no message. I entered a two letter string, click filter and got the error message.

    Therefore, closing as cannot outdate. If you are experiencing this problem on a supported version of Drupal reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue β†’ (starting from "Install Drupal core").

    Thanks!

  • Status changed to Active over 1 year ago
  • πŸ‡¨πŸ‡­Switzerland Baher

    Hi,

    I reopen this issue.

    Step To Reproduce

    1- Create a View
    2- Add search keywords as Filter Criteria
    3- I suppose I'm searching for the word Drupal. If I wrote the string "Drupal". I have the result displayed.
    4- I suppose I'm searching for the word Drupal. If I wrote only "Dru". I have no result displayed.

    Baher

Production build 0.71.5 2024