Needs work
Project:
Real Name
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Dec 2010 at 07:53 UTC
Updated:
19 Jan 2016 at 22:07 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirI think it's realname.module's job to provide a username autocomplete callback. To keep it backwards compatible, it could search for both usernames and realnames, display the realname (maybe both?) in the autocomplete suggestions and then use the username as the key.
I am not sure if it should actually override the default autocomplete, maybe it would be better to provide a separate one, although that would require that all modules which want to do this add a special check and use the other one. Maybe configurable even?
Comment #2
berdirOh, and I can of course provide a patch based on whatever we decide here :)
Comment #3
moonray commentedPerhaps you can use code from this module I wrote as a base. It's a bit customized and would need to be partially re-written to work for realname module.
Comment #4
jzornig commentedAdd the following to realname.module to override the user autocomplete with realname autocomplete.
Comment #5
jzornig commentedComment #6
brightboldConfirming that this patch worked for me. Yay! Greatly appreciated.
Comment #7
xDudditzx commentedThis doesnt work for me in Drupal 7.15 with -devEDIT: Sorry, I did not have pm module option enabled.
Works fine
Comment #8
WorldFallz commentedthere's no actual patch to review here
Comment #9
jzornig commentedPatch for review included.
Comment #10
hass commentedYes, if users only see their realname in autocomplete field we need to search for both or only the realname as this is what the users expect. We just has this failure here and it is very confusing to the users.
Above patch is all we need?
Comment #11
hass commentedFixed code style (tabs) and new D7 Implements.
Comment #12
hass commentedThis works as expected. I expected this works for entityreferences too, but it does not :-(. entityreferences follow up patch is in #1722112: Autocomplete for entityreference fields
Comment #13
hass commentedUsers are completly confused and we cannot explain them that the autocomplete requires to enter the username, but it shows the real name as found match/suggestion. Therefore they are not able to find other people as usernames could also be very strange and random names, too.
This is a clear usability fail.
Comment #14
Taxoman commentedComment #15
hass commentedComment #16
hass commentedThere seems to be a validation issue in node forms. This fails and the form error is shown:
Comment #17
hass commentedOh, no it's my patch in #1722112: Autocomplete for entityreference fields that causes this issue.
Comment #18
nibo commentedThe patch is not really complete. I can search after a real name and get those as suggestion, but the username still gets shown in the textfield after selecting the suggested real name.
Comment #19
berdirThat is by design. Actually handling realnames as the values requires changes in the modules that provide the autocomplete field and a lot of complex logic to deal with duplicates and so on.
Can't be changed here.
Comment #20
hass commentedCan we get this committed now? It looks like the maintainers are not really active.
May I get co-maintainer permissions, please?
Comment #21
jonanthony commented#subscribe - really useful patch
Comment #22
dave reidI tweaked this a bit to move the realname_menu_alter() to below realname_menu() like it should be, and in the autocomplete added a ' ($acccount->name)' to the results if the format_username() result does not match $account->name. This should maybe help some of the WTF with finding a specific username in the results and clicking it, the value in the text field not matching what the user clicked.
Committed and fixed in 7.x-1.x. http://drupalcode.org/project/realname.git/commit/32413b1
Comment #23
eminencehealthcare commentedThis is great Dave. I am wondering if there is a way to display the realname in the actual field though (instead of in the dropdown to select the field) Is this possible? String override or something?
Comment #24
dave reidThis is not really possible right now. Node forms that use the autocomplete expect to have the actual login name in the field since it is used for validation. Displaying real name would cause all those forms to fail validation.
Comment #25
eminencehealthcare commentedThanks for the quick response. That makes sense. I think I will just "fake it" by using a rule to set node author from user reference field and then fill another field with author realname.
Comment #26
askibinski commentedJust posting here a reference to #1935218: Hide blocked users in autocomplete where I attached a patch to hide blocked users from this autocomplete.
Comment #27
Renee S commentedAn alternate solution, @eminencehealthcare, to the display thing could be to use a custom formatter, using a View that takes the username and returns a realname.
Comment #29
molenick commentedReopening this, it seems to never have been resolved. To me it seems confusing and counterintuitive to people on a live site.
In my current use case I'm using realname and entityqueue to populate some user queues. The autocomplete field doesn't work as expected - it expects input from the drupal user account but returns output from the Real Name field.
To me it seems like the most straightforward solution is to disable realname for autocomplete, but I understand this may be contentious.
Comment #30
julou commentedI have the same problem as #29: autocomplete works on user account, it proposes real names in a drop down list and finally shows the user account.
Issue changed to active.
Comment #31
hass commentedThat is the way how core works. We cannot change this.
Comment #32
johannez commentedHello guys,
I ran into similar issues as described above. I use the Entityqueue module for staff listing views. The autocomplete field was displaying the first name and last name nicely, but didn't accept any spaces, nor did it accept the username. I took a look at your override there for the autocomplete path and noticed that the EntityReference field must have changed their widget structure a bit in the last year.
After I adjusted the widget in the hook_widget_form_alter your /realname/autocomplete kicks in with all it's beauty and let's me drill down to my user with spaces and usernames.
I attached my simple patch and hope you can get it in for the next dev version.
Cheers,
Johannes
Comment #33
johannez commentedSorry, forgot to include the widget type name change. In the past it was entity_reference, but that changed to entityqueue_dragtable. Please use this instead of #32.
Comment #34
Abelito commentedThe patch in #33 worked for me to solve this issue with the EntityReference module autocomplete: https://www.drupal.org/node/1978274
..but this one looks more directly relevant, and it worked too: https://www.drupal.org/node/2261665#comment-10513164
Comment #35
heddnLet's get some eyes on the patch.
Comment #40
johannez commentedComment #41
hass commentedCode wise this can only wrong