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.
Is there a similar module to allow autocompletion for user references using real names in D7. It doesn't look like there are plans to port this module to D7. Are there other modules/solutions to this issue in D7?
Comment | File | Size | Author |
---|---|---|---|
#18 | user_reference-realname-search.patch | 1022 bytes | erykmynn |
#11 | user-reference-autocomplete_on_realname.patch | 1.11 KB | liquidcms |
Comments
Comment #1
liquidcms CreditAttribution: liquidcms commented+1
Comment #2
GuillaumeDuveauI don't know about D7 since I'm still on D6 for the site thats needs that module and don't plan to upgrade any time soon, sorry. I confirm that there are also no plans to port this module to D7, but I'll leave that issue open to let you talk about alternatives.
Comment #3
fuzzy76 CreditAttribution: fuzzy76 commentedsubscribing
Comment #4
Xigi CreditAttribution: Xigi commentedsubscribing
Comment #5
liquidcms CreditAttribution: liquidcms commentedi think Views/CCK (in D6 as well) is able to do what this module does by simply making a View that lists the Realnames of the users and then having the field use that View as it's reference.
still some bugs in Views for doing this.. but more or less works (you must keep Label enabled and then just not fill anything in): http://screencast.com/t/xD8bePe7xsO
the list shows realnames but once picked the field shows username... but close.
not sure what the autocomplete is on.. will test
Comment #6
liquidcms CreditAttribution: liquidcms commentedhmm.. nope.. sadly the autocomplete is on the username; not on the value that shows from the View.. this is likely a bug in some module, perhaps References.
Comment #7
aliceduck CreditAttribution: aliceduck commentedliquidcms, could you elaborate on what you meant in #5?
Comment #8
liquidcms CreditAttribution: liquidcms commentedHi alice, which of my points in #5 are you asking about? i stated quite a few things there.
the screeshot shows most of what i meant pretty clearly.. the selector being shown for item 2 shows the View of realnames being used as the reference for this field (which is good), but item 1 "student1 [uid=5]" shows that it still lists the username once selected.
the 3rd point is what does the autocomplete search on.. and sadly it is still on username.
to be even more clear, by example.. from my example in screenshot:
if i type "two" for autocomplete it will not match anything, but "ent2" will.
Comment #9
moonray CreditAttribution: moonray commentedThe search part of references module's views implementation is hard-wired to the name field. I'm not sure if they'd be into changing that (or if it's even possible without major changes).
Comment #10
liquidcms CreditAttribution: liquidcms commentedi posted part of the solution with a module i just whipped up here: #1296254: userreference formatter
this adds realname formatters for userref fields.
tomorrow i'll likely look at doing an autcomplete widget that works off realname and add it in with this module
assuming i have both of these in place; does that make the D7 version of this module?
Comment #11
liquidcms CreditAttribution: liquidcms commentedthis patch fixes the userref autocomplete to search on realnames but has a dependency on the realname module.. not sure if that's a big deal or not.
Comment #12
liquidcms CreditAttribution: liquidcms commentedComment #13
mgiffordPeter, not sure how to test the patch you provided. The files it refers to aren't in this module and user_reference doesn't exist as a module that I can see:
http://drupalcode.org/project/realname_userreference.git/tree
Comment #14
liquidcms CreditAttribution: liquidcms commentedahh.. sorry.. i think i forgot what project this post was initially started on.. i don't think (at the time) there was a realname userref port to D7; and work was being done on the references project to support this sort of feature. my patch is actually on that module.
Comment #15
dealancer CreditAttribution: dealancer commentedAs patch at #11 is for user reference module I am changing project for this issue.
Comment #16
dealancer CreditAttribution: dealancer commentedComment #18
erykmynn CreditAttribution: erykmynn commentedThe patch worked great for me. It shouldn't be dependency because it just provides it if its there but doesn't rely on it. I think the patch failed for having some non-standard header lines. I am uploading the version I used, but it only works with some fuzz since the line numbers and some of the surrounding lines are now out of date. Regardless it worked for me, and adds this cross-module support which is totally key for User Reference and Realname to play nice (and work as someone would expect).
Comment #20
danielb CreditAttribution: danielb commentedWhen you enable realname, will 'rn.realname' exist straight away for every user?
Why have you only changed code for 'contains' matching but not the others? Wouldn't validation fail in some cases because of this?
Real name is 'incompatible' with several modules because of it's design. It does not replace usernames, but rather adds it's own data, as it is possible for two people to have the same real name. This is also the reason it is an unreliable candidate for an autocomplete, though node reference has an issue with that too.
Comment #21
jzornig CreditAttribution: jzornig commentedThere is a patch to realname in http://drupal.org/node/985944 to replace the user/autocomplete with realname autocomplete. This might "just work (tm)" if references currently is using user/autocomplete.
Comment #22
chunglk CreditAttribution: chunglk commentedComment #23
mgiffordOk, so this is a new module, right? Just looks like you renamed it.
Either way would be good to have the code reviewed and have it up on d.o.
Comment #24
geerlingguy CreditAttribution: geerlingguy commentedUnfortunately, the References module uses its own autocomplete (at
user_reference/autocomplete/%/%/%
), so it will require more work to either start using user/autocomplete or integrate with Realname properly.