First Name Last Name Disappear When Members Edit Profile

In my list of users I have manually added First and Last Names for all of my Users, but when they Edit their profiles the First and Last Name disappear on the List of Users.

Please see screenshot. I edited profile for "test" and changed First Name and Last Name. Now they have disappeared from my List of Users.

I tried a plugin that is supposed to sync WP and BP User First and Last Names but what it did was put two First Names and two Last Names on the Profile page. I think this could work if I could get rid of one set.

Would appreciate suggestions.
Thank you.
Support Access is granted.

  • Predrag Dubajic

    Hi Mary,

    You mentioned in one of your other threads that you've been removing users from DB and even though that's a different issue did this one with name changing started happening after those changes?

    Have you tried restoring backup of pre DB changes to staging site to see if this could be related to that as well?

    Are the changes users are making made from back or front end of your site and does it happen in both cases?

    Best regards,
    Predrag

  • Adam Czajczyk

    Hello Mary,

    I accessed your site and tested it. For this, I created myself a basic user account and setup first and last name as an admin. Then I logged in as this user and edited my profile and I can confirm that the name in the back-end list has been removed.

    Here's what seems to be happening here:

    1. From backend you or user you are editing WP native "First name" and "Last name" fields. These fields are used together by WordPress to display first and last name on the list in the "Name" column by default

    2. In BuddyPress profile fields you got defined "First Name" and "Last Name" fields. By default BP profile fileds include a filed called "Name" and this is automatically synchronized to native WP "First Name" and "Last Name" fields. It looks to me though like that field has been removed from your BuddyPress profile fields set.

    3. As a result, none of the existing fields are synchronized with native WP fields and the default BP name field is being send as empty string when you save BuddyPress profile.

    Such an empty string simply clears the native WP "First Name" and "Last Name" fields.

    How to fix this?

    We need a way to sync your BuddyPress "First Name" and "Last Name" fields with their native WP equivalents. I do not know how these fields were created on your setup but it seem like they were added by the plugin that you mentioned or manually.

    If they were created by the plugin but not removed, they are no longer in sync. Manually added fields are not synchronized either. The plugin that worked great for me when I tried to replicate the case on my setup was this one:

    https://wordpress.org/plugins/bp-xprofile-wp-user-sync/

    After I installed it and enabled it did add "First name" and "Last name" fields and perfectly synchronized them with native WP "First name" and "Last name" fields so regardless whether I edited these fields in WP profile or BuddyPress profile or as admin or use - data was synchronized and displayed correctly.

    I think this should help here as well. Please note though: since there are already "First Name" and "Last Name" fields, this plugin may either hook up to them (that would be good) or create additional ones. In such case you would need to "test edit" your test user to identify which pair of the fields is kept in sync and which is not and then remove that pair that's not.

    Kind regards,
    Adam

  • Adam Czajczyk

    Hello Mary!

    Thank you for your response.

    As you didn't give a name of a plugin I assumed that it was a different one. I'm a bit confused because on my setup deactivating the plugin (and it was clearly not even there on your site when I was checking it) also removes these fields automatically. And with an active plugin, a synchronization works perfectly fine for me.

    Getting back to the start then. Before you installed the plugin: were there "First name" and "Last name" fields or not? Was there just the "Name" field (set as "required, primary")? Even before giving the plugin a try, nothing synchronized as well?

    Let me know please!
    Best regards,
    Adam

  • Mary

    You are correct. I had removed it because of it creating double fields for First Name and Last Name. I will install and try again if it worked for you.

    This time I just activated it on the main site instead of Network Activating, and although it gave me double First and Last names, when I changed the top ones to "not required" they disappeared, so I now am back to just having one First Name and one Last Name with the plugin activated, however when I go into "test" profile and add a First and Last name, they still don't show up in my Users list.

    Perhaps I've deleted the wrong First and Last name fields?

  • Mary

    Update: I thought I had deleted those fields but in reality they had just moved to the bottom of the page and it turns out that those are the ones I need, so I marked the others as "Ignore these boxes" for now, until I can find out how to remove them.

    Please see screenshot that shows:
    First Name
    Last Name
    Display Name
    Ignore this box
    Ignore this box
    Age

    You will see that the only field with a Delete option is Age, so how do I get rid of the two "Ignore this box" fields. phpMyAdmin?

  • Mary

    Interesting. I hadn't done anything (that I remember) with it so just went in and checked and in Edit Profile I no longer have a First Name text box at all. Instead I have

    Warning: Creating default object from empty value in /home/mary/public_html/mary-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-group.php on line 452

    Please see screenshot.

    When I went in to test if it was the right Last Name I changed it to "Testing" and saved. Now in my Users List there is nothing for first or last names.

  • Predrag Dubajic

    Hi Mary,

    I did some research and these kinds of errors are usually related to outdated PHP version but you're already on version 5.6 so this shouldn't be the issue in your case.

    I couldn't find any more information about this and I'm afraid that there's not much more we can do about it here and it might be best checking on BuddyPress support forums about what could be causing this error.

    You should be able to hide it from your users by adding this line to your wp-config.php:
    @ini_set('display_errors', 0);

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.