Make WordPress Core

Opened 6 weeks ago

Last modified 4 weeks ago

#61469 new defect (bug)

Display name doesn't update correctly when first and last name fields are cleared.

Reported by: lekiq's profile lekiq Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.5.4
Component: Users Keywords: has-testing-info needs-patch
Focuses: privacy Cc:

Description

When a user fills out the "First Name" and "Last Name" fields in their profile and selects a display name option, the display name reflects the first and last names correctly. However, if the user later removes the values from the "First Name" and "Last Name" fields, the display name still displays the previously entered first and last names. The display name only updates correctly if the user also changes the "Display name publicly as" field. This behavior can be confusing and inconsistent.

Steps to Reproduce:

  1. Go to the profile editing page.
  2. Enter values in the "First Name" and "Last Name" fields.
  3. Select a display name option that includes the first and last names.
  4. Save the changes.
  5. Remove the values from the "First Name" and "Last Name" fields.
  6. Observe that the display name still shows the previously entered first and last names.
  7. Change the "Display name publicly as" field to any other option and then back to the desired option.
  8. Save the changes.
  9. Observe that the display name now updates correctly.

Expected Behavior:
The display name should automatically update to reflect the cleared "First Name" and "Last Name" fields without requiring additional changes to the "Display name publicly as" field.

Actual Behavior:
The display name does not update and still shows the previous first and last names unless the "Display name publicly as" field is manually changed.

Change History (4)

#1 @sudipatel007
5 weeks ago

  • Keywords needs-patch has-testing-info added

I can reproduce the same issue - https://www.loom.com/share/7b471840227e4f6e8b6f129b38843bd3

Environment

  • WordPress: 6.6-beta2-58420
  • PHP: 8.1.23
  • Server: nginx/1.16.0
  • Database: mysqli (Server: 8.0.16 / Client: mysqlnd 8.1.23)
  • Browser: Chrome 126.0.0.0 (macOS)
  • Theme: Twenty Nineteen 2.8

This ticket was mentioned in PR #6911 on WordPress/wordpress-develop by @khokansardar.


5 weeks ago
#2

  • Keywords has-patch added; needs-patch removed

On removing the values from the "First Name" and "Last Name" fields observe that the display name still shows the previously entered first and last names in edit user.
This PR fix this issue.

Trac ticket: #61469

This ticket was mentioned in PR #6911 on WordPress/wordpress-develop by @khokansardar.


5 weeks ago
#3

On removing the values from the "First Name" and "Last Name" fields observe that the display name still shows the previously entered first and last names in edit user.
This PR fix this issue.

Trac ticket: #61469

#4 @sudipatel007
4 weeks ago

  • Keywords needs-patch added; has-patch removed

Test Report

I have tested with this patch but still it is not working.
https://github.com/WordPress/wordpress-develop/pull/6911.diff

Environment

  • WordPress: 6.6-beta2-58420
  • PHP: 8.1.23
  • Server: nginx/1.16.0
  • Database: mysqli (Server: 8.0.16 / Client: mysqlnd 8.1.23)
  • Browser: Chrome 126.0.0.0 (macOS)
  • Theme: Twenty Nineteen 2.8
Note: See TracTickets for help on using tickets.