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.
Node Reference Autocomplete is case sensitive in PostgreSQL. So typing in 'John' will not find a node named 'john' and vice-versa.
It looks like the private message module had a similar issue and managed to fix it:
Comment | File | Size | Author |
---|---|---|---|
#9 | cck.470470-3.patch | 2.81 KB | neilnz |
#2 | cck.patch | 794 bytes | jamespharaoh |
#1 | nodereference.module.pgautocomplete.patch | 863 bytes | neilnz |
Comments
Comment #1
neilnz CreditAttribution: neilnz commentedAttached a patch that I used to fix this issue for me (replaced LIKE with ILIKE when using pgsql)
Comment #2
jamespharaoh CreditAttribution: jamespharaoh commentedThe previous patch submitted will change the word LIKE indiscriminately throughout the SQL statement. My patch, attached, will only change it where appropriate.
Comment #3
neilnz CreditAttribution: neilnz commentedBacked out my patch from #1 and applied #2, confirmed working as expected on Postgres 8.3.7.
Comment #4
neilnz CreditAttribution: neilnz commentedThis is still an issue in latest 2.x-dev and 3.x-dev. Could someone please apply this?
Comment #5
carpo CreditAttribution: carpo commentedJust came across this issue myself, and noticed that the change also has to be made in the function content_plugin_display_references in content_plugin_display_simple.inc and the function _userreference_potential_references_standard in userreference.module
Comment #6
KarenS CreditAttribution: KarenS commentedSounds like this patch is not complete and no one has confirmed that it doesn't break things in MYSQL.
Comment #7
Josh Waihi CreditAttribution: Josh Waihi commented#2 will work fine in PostgreSQL and will not effect MySQL. I RTBC this, but it is also an issue in user reference. could we get that fixed there too?
Comment #8
KarenS CreditAttribution: KarenS commentedI marked this needs work because #5 says there are more places that need to be fixed, so the patch is not ready. Does 'will not affect MYSQL' mean you actually tested it or are you just guessing?
Comment #9
neilnz CreditAttribution: neilnz commentedHere's a new patch, incorporating the fix from #2 in those other places
Comment #10
neilnz CreditAttribution: neilnz commentedI just tested this patch on MySQL and Postgres on a fresh install of Drupal 6 CVS with CCK 2.x-dev from the project page both with and without the patch.
I created two fields on the default page type, a nodereference autocomplete ("contains") and a similar userreference autocomplete field.
I created a page and user with mixed case title/username and then attempted to reference them.
MySQL was case-insensitive both before and after the patch, Postgres was case sensitive before but not after, so I'm very confident that my patch from #9 doesn't affect MySQL, and solves both nodereference and userreference autocomplete case sensitivity issues on Postgres.
Thanks
Comment #11
KarenS CreditAttribution: KarenS commentedThanks for the very complete patch and report, fixed committed.
Comment #12
Fidelix CreditAttribution: Fidelix commentedThe patch returned:
patching file cck/includes/views/handlers/content_plugin_display_simple.inc
Hunk #1 FAILED at 22.
1 out of 1 hunk FAILED -- saving rejects to file cck/includes/views/handlers/content_plugin_display_simple.inc.rej
patching file cck/modules/nodereference/nodereference.module
Hunk #1 FAILED at 876.
1 out of 1 hunk FAILED -- saving rejects to file cck/modules/nodereference/nodereference.module.rej
patching file cck/modules/userreference/userreference.module
Hunk #1 FAILED at 774.
1 out of 1 hunk FAILED -- saving rejects to file cck/modules/userreference/userreference.module.rej
Sorry if its my noobiness.
Comment #13
neilnz CreditAttribution: neilnz commented@Fidelix, make sure you're using CCK 6.x-2.x-dev, otherwise this patch won't apply and you'll have to backport it manually.
The changes are relatively minor (6 lines changed across 3 files), so you should be able to do it by hand if you need to.
Comment #14
KarenS CreditAttribution: KarenS commentedThe patch is committed. If you use the dev version it is there.
Comment #15
Fidelix CreditAttribution: Fidelix commentedSorry, i was using 3.x. My bad.