Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
To reproduce
- create a new Autocompletion Configuration, and check that "Minimum keyword size that uncouple autocomplete search" is set to for example "3".
- Go to a search box and type a single character and see that autocomplete is activated.
Comments
Comment #2
ressa CreditAttribution: ressa as a volunteer commentedComment #3
sittard CreditAttribution: sittard commentedConfirming same issue as reported above with the search block and autocompletion_callbacks_words::words_autocompletion_callback as the callback.
Frequently results in the user getting the warning message on the subsequent page load.
Thanks
Comment #4
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedHi ! thanks for reporting, I will have a look as soon as possible.
Comment #5
Ujwala_D CreditAttribution: Ujwala_D as a volunteer and at Faichi Solutions Pvt Ltd for Faichi Solutions Pvt Ltd commentedHi,
I have created patch, in which minimum character has been validate to activate the result.
PFA of patch file.
Thanks
Comment #6
sittard CreditAttribution: sittard commentedPossible duplicate: https://www.drupal.org/node/2839543
Comment #7
Ujwala_D CreditAttribution: Ujwala_D as a volunteer and at Faichi Solutions Pvt Ltd for Faichi Solutions Pvt Ltd commentedHi sittard,
I have checked the patch given in 'Possible duplicate: https://www.drupal.org/node/2839543'. But those changes are related to setting 'maximum number of suggestion to display' not to 'minimum number of character a user must input before auto completion starts'.
I think this issue is related to restrict the number character user enters in search textbox. So Please go through the patch which is have created in comment #5.
Thanks
Comment #8
sittard CreditAttribution: sittard commentedOn further reading I see you are correct - thanks.
Comment #9
riddhi.addweb CreditAttribution: riddhi.addweb at AddWeb Solution Pvt. Ltd. commented@Ujwala_D,Thanks! for the patch, it works well, but face some issue during RTBC
like.1) When I tried autocomplete functionality with Tags Field it didn't work for me Also there is no option to check for "Use Autocomplete".
2) When I use filter with Body it shows
<P>
tag with suggested value.PFAComment #10
Ujwala_D CreditAttribution: Ujwala_D as a volunteer and at Faichi Solutions Pvt Ltd for Faichi Solutions Pvt Ltd commentedHi Jigar.addweb,
Thanks to make this patch perfect. As you mentioned in comment #9,I could not reproduce the #2 point Otherwise,I have done with solution.PFA
Thanks
Comment #11
riddhi.addweb CreditAttribution: riddhi.addweb at AddWeb Solution Pvt. Ltd. commented@Ujwala_D,Thanks! for the patch solution it works for tag field now but when i use it it shows me count with results.
Steps to reproduce #2 issue :-
1) Install Search Auto complete and view auto complete filters and enable it.
2) Create new view.
3) Add fields for like title, body and tags.
4) Create Expose Filter for body,Title & tag field. Select operator as "contains" from drop down.
5) In the filter settings also select use auto select checkbox, and also set minimum number of characters to start filter as 3.
6) Save that View.
7) In Body filter write content and you will see
tags in textbox, if you select that value as a selected value it reflects
with that value also.
Note : For better clarity i can provide you my simplytestMe link if you want.
Comment #12
Ujwala_D CreditAttribution: Ujwala_D as a volunteer and at Faichi Solutions Pvt Ltd for Faichi Solutions Pvt Ltd commentedHi Jigar.addweb,
I able to reproduce the issue for body field with 'minimum number of character to start filter' settings. But This issue is related to 'views autocomplete filters' module not to search autocomplete module.
So you can raise same issue for 'views autocomplete filters' module.
One more thing, regarding the showing count with result in tags fields, Its a drupal default behaviour, Even if you uninstall the search autocomplete module, It remain same as you get before.
Still you have any issue let me know.
Thanks
Comment #13
mortona2k CreditAttribution: mortona2k at Forum One commentedThis patch is working for me. It sounds like the issue above should be addressed somewhere else. Thanks for your work on this!
Comment #14
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedKeep the last response(suggestions) since it is done in each cases
This seems useless since if here, we should allow autocompletion. 'search' event, handled via 'searchHandler' method is here to ensure that.
Best would be to personnalize minLength value per instance, just how it is done for blacklist characters.
Should not be here. How JS is added is another issue.
Comment #15
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedAccording to my review in comment #14:
For me patch #10 is not a proper solution. The workflow is that search event is triggered if options passes (minLength included), then the HTTP request to get the results is performed. After that the patch adds another check for minLength to eventually cancel the autocompletion. This is odd and has poor performance.
Better would be to customize minLength value per instance (just has done with "firstCharacterBlacklist"), thus it would be included in 'search' event verif, before AJAX call is done.
Here is a patch attached with this approach.
Comment #16
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedChanged the test to actually be compatible with core autocomplete.
Comment #17
sittard CreditAttribution: sittard commentedI agree with @Dom - As a quick fix we also changed jquery.autocomplete.js
That seems to work but obviously the patched solution should get the minLength from the configuration.
Thanks.
Comment #18
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commented@sittard: the patch I provide at #16 has a configurable minLength.
Comment #19
apmsooner CreditAttribution: apmsooner commentedPatch in #16 works fine for me.
Comment #20
ressa CreditAttribution: ressa commentedThis seems to no longer be an issue, so closing this issue.
Comment #21
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commented@ressa there are multiple people reporting on the patch fixing the problem, I think this is still valid bug.
Comment #22
doublealpha CreditAttribution: doublealpha commented@ressa: I am also facing this issue still. Minimum keyword size was set to 3 in configuration but suggestions were activating after entering a single character. #16 fixed it.
Comment #23
ressa CreditAttribution: ressa commentedI might have originally created (2016) and tested (2019, #20) the issue in Drupal 7, but I agree that we should keep the issue open if it still happens in Drupal 8.
Comment #25
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedThanks a lot for help and review.