I've just imported a bunch of users from D7 tables to a backdrop database (by exporting/importing tables from PHPMYAdmin) - and am only now noticing that about half of users when I list them at /admin/people have their 'username' shown as their account name (in my case called "Practitioner Name"). i.e. if a user with name "Matt Washington" had the username mattw12 and a user named "John Peters" had the username jpeters, under manage user accounts it might look like:
USERNAME: Matt Washington jpeters ...
(SOME are the actual username for their login as intended, others are their actual name that is included in their user profile.)
If it was all of them I would have assumed I imported the tables incorrectly, but it's very close to 50/50 without a pattern I can find browsing the database tables (though I'm far from a database wiz.) When I manually add NEW accounts they always show with the actual name not the username.
When I edit a user (/user/4304/edit) the same thing occurs with the 'title' of the edit user page (and the breadcrumb.) If it shows the username in the user list, the title shows the username. If it shows the real name ie the list, real name shows as the title here.
What have I broken here? Other than the title/breadcrumb; if I edit a user account everything looks just fine (no real difference between the ones that display with their 'practitioner name' and those with their username.)
I'm particularly concerned because some of my templates include some PHP code that uses the username and won't function properly if the actual name gets returned.
Any thoughts much appreciated! Unfortunately I didn't notice until things went live since things seemed to work ok :P
Thanks!
Comments
Ok, after some more examination it appears that whether things are showing the username or the users NAME is correlated to the 'realname' table. This is one I did not port over from the D7 database (nor does it exist as a table by that name.)
If the user doesn't have a 'realname' in the realname table, it's showing the actual username (the login username.) If they do it shows this realname entry instead.
That's good to know, but now I'm pretty confused as to how 60% or so of the users I imported wound up with a 'realname' while the rest did not. All the users imported had/have names that show just fine when editing/looking at a user profile.
Also, for the sake of consistency I'll prefer they all display the same even if it's not the way I thought they would - is there a simple way to rebuild the realname table with current user information, or do I need to edit the database?
And as trivial as it is, I'd argue that under 'user accounts' the table header USERNAME is a bit of a misnomer, I think most people would associate that with USERNAME/PASSWORD given that it's an actual field called the same. Maybe this can just be 'USER' or at least 'USER NAME' to differentiate? As you can see it certainly confused me at least! :)