Provide a way of setting a minimum length before a (ajax) search call is triggered... Patch extracted from #942632: Monster issue.
Required to be set to "3 characters" for "Drupal search" to avoid error messages.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 1063188-4-min-title-length.patch | 3.45 KB | bforchhammer |
| #2 | 1063188-2-min-title-length.patch | 2.9 KB | bforchhammer |
| min-title-length.patch | 2.81 KB | bforchhammer |
Comments
Comment #1
danchadwick commentedJust noticed that "3" does not appear to be hard-coded in the search module, or at least the UI implies that if you visit /admin/settings/search.
+ $lower_limit = ($form_state['values']['uniqueness_search_mode'] == UNIQUENESS_SEARCH_MODE_DRUPAL) ? 3 : 1;Comment #2
bforchhammer commentedYou're right, it's not hard coded; it's stored in the 'minimum_word_size' variable... Attached patch uses that instead of '3'.
Comment #3
danchadwick commentedCurrent minimum should be enforced not just at config time, but also at run time:
Because the search limit could have been lowered after uniqueness was configured. minCharacters should be the lesser of the two variables.
Comment #4
bforchhammer commentedHere we go... (not very elegant, but it does the job).
Comment #5
bforchhammer commentedComment #6
bforchhammer commentedCommited.