Active
Project:
Autocomplete Widgets for Text and Number Fields
Version:
7.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
31 Jul 2011 at 14:22 UTC
Updated:
29 Sep 2012 at 22:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bleen commentedI havent really had time to test this, but i think this'll do it.
Comment #2
bleen commentedoops ... wrong version of the patch
Comment #3
bleen commentednow this is just embarrassing ... ignore #1 & #2
Comment #4
cees.vanegmond commentedbleen18, sorry #3 doesn't work as expected. I tried to look into it but my drupal module experience is not sufficient to do this task.
side note: I saw that exposed filters in views also supplies the autocomplete widget, I tried to select the autocomplete widget but it doesn't seem to function at all.
Comment #5
bleen commentedcees.vanegmond: Can you please send me an example of the "predefined suggestions" you are entering and then examples of what you are typing and what results you are getting vs. expecting.
Here is a quick screencast of what i am seeing which I believe is the correct behavior: http://screencast.com/t/hD900irbER8d
If you can give me an example of how this isn't working Ill take another look. In the mean time I'm committing the patch in #3 since its cleaner code and marking "works as designed"
Comment #6
cees.vanegmond commentedWell, for example the following list, the days of the week:
Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday (on separate lines in the form field)
I would like to have te option of case insensitive input, when an user types "mon", Monday should occur and be able to get selected.
This case insensitive setting can be set in the edit tab next to the widget tab.
---
Case sensitive
o Disabled
o Enabled
Case-insensitive queries are implemented using the LOWER() function in combination with the LIKE operator. Note that MySQL might ignore case sensitivity depending on the collation used in your database definition (see Internationalization and Localization chapter in the MySQL manual). If you need case insensitive checks, it is recommended (for performance reasons) to use a case insensitive collation as well (such as utf8_general_ci), rather than disabling the case sensitive option here.
---
By disabling case sensitive I expect the behaviour as I describe above.
Note: Node reference and Term reference have the same behaviour
Comment #7
sportel commentedHi,
I've got the same problem. I'm using a predefined list of languages to choose from, al beginning with a capital. When entering "ned", nothing shows, while when entering "Ned", "Nederlands" shows in the list. I'm using the latest advised D7 version. Hope you can help.
Thanks,
Mike.
Comment #8
bleen commentedI finally took another look at this and I think I found the problem. This patch should take care of it... (and make the code a bit easier to read).
Comment #9
Desi Raaj commentedI can confirm this fixes the problem, thank you so much :)
Comment #10
bleen commentedI'll take that as an RTBC....
I've committed this to the latest dev version of 7.x-1.x (http://drupalcode.org/project/autocomplete_widgets.git/commit/7621c46)
Comment #12
arbel commentedHi,
I'm using the latest dev and tried beta 2 and it doesn't seem to work.
when searchiing for:
berlin
I get no results.
when searching for Berlin
I get multiple results.
I don't completely understand the sentence under the setting for case sensitive....
Thanks
Idan
Comment #13
cees.vanegmond commentedFinaly I took time to look into this item since it's not working.
First of all on line 133 and 177 of 'autocomplete_widgets.common.inc' $case_sensitive is retrived from $field['widget']['autocomplete_case'], this should be $field['widget']['settings']['autocomplete_case']
Next item is that the use of empty() gives strange behaviour, if Case Sensitive is disabled (=0) then empty() returns true. If Case Sensitive is enabled (=1) then empty() returns false. I don't see the point.
Furthermore I made the following changes to function _autocomplete_widgets_get_options_suggested() to fit my expectations for the function:
This returns the case sensitive value in the 'Suggeset values list' even the search has be done case insensitive.
I think that the 'equal case' should also be changed in the same manner, this has not been implemented in code above.
Comment #14
bleen commentedcees.vanegmond:
Comment #15
cees.vanegmond commentedText processing: Plain text
Autocomplete matching: Contains
Case sensitive: Disabled
Filter HTML: Disabled
Suggeset values list: (states of The Netherlands)
Drenthe
Flevoland
Friesland
Gelderland
Groningen
Limburg
Noord-Brabant
Noord-Holland
Overijssel
Utrecht
Zeeland
Zuid-Holland
When I use an exposed filter in a view, or just entering data in a new or existing node, I would expect the module to return for 'hol' both Noord-Holland and Zuid-Holland. This is not the case with 7.x-1.0-beta2. The reason why I'm expecting this behaviour is that this is the same for taxonomies for example.
Comment #16
bleen commentedTo create a patch, please see the instructions here: http://drupal.org/patch
Its not very hard, I promise
Comment #17
valve79@gmail.com commentedInstalled the RC1 and the Upper/lower case issue still exists.
Looked through the patches.
Which patch should i use ?
Or can some one point me in right direction to change the right chunk of code ?
Comment #18
TimTheEnchanter commented@valve79
If you are using the option "Autocomplete for existing field data and some node titles" there is a conditional statement that hides the field setting for Case Sensitivity. Commenting out the IF statement worked for me
Line 31 of autocomplete_widgets.admin.inc (7.x-1.x-dev)