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.
I would like to have users' Real Name (as supplied by the Realname module) show instead of the 'Username' on group chats - right now it looks like, at some point during the creation of a chat message, the $message->name
is filled with the user's username, but is there a way to either hook into the username as displayed by RealName, or retheme the username in general?
Thanks for a great module!
Comment | File | Size | Author |
---|---|---|---|
#5 | screenshot.png | 53.63 KB | sylvaticus |
#3 | chatroom-realnames-not-showing.png | 33.64 KB | geerlingguy |
Comments
Comment #1
sylvaticus CreditAttribution: sylvaticus commentedSame request here.. I have a vague memory of some other cases where the realname wasn't displayed properly because the call made by a certain module to retrieve the username wasn't the best-practice one but a more "direct" call that was skipping the realname modifications..
[edit]
On the Realname project they state:
Other Modules
Almost all other contributed modules can properly display the Real Name if they change their code to use theme('username', ...) rather than just grabbing the user name from some object. We simply cannot be adding specialized support for thousands of contributed modules, especially when the solution is so simple (and Drupal-correct).
[/edit]
Comment #2
gregglesCan you post a screenshot of where the realname module doesn't do it's magic?
That would help pinpoint where the call to theme('username' isn't happening. Looking at the code I see that it is using the proper theme('username' in most cases.
Comment #3
geerlingguy CreditAttribution: geerlingguy commentedAttached is a screenshot from a chat room message listing on a private site of mine. All the names displayed are the user names of the users, rather than the 'Real Name' values.
For example - user archstl is displayed as "Archdiocese of St. Louis" everywhere else on the site, and even in the list of active chat participants. But in the chat itself, the name appears as "archstl", the username.
Comment #4
gregglesOK, that makes sense. Thanks!
Comment #5
sylvaticus CreditAttribution: sylvaticus commentedhere is an other screenshot.. "X000097" is the username (not very nice, is it??) and "ANTONELLO" is the realname.
[OT]: do you know how to receive email notification of new posts??[/OT]
Comment #6
jct CreditAttribution: jct commentedThis appears to be related to the issue http://drupal.org/node/488360. The theme_chatroom_message_username function in chatroom.theme.inc is still using l(...).
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedthanks for report.