Problem/Motivation

On the user pages (e.g. password reset page - after click on the password reset link), the user name is displayed instead of User's Display name. \Drupal\user\UserInterface::getDisplayName() should alway used when a user name is shown to the user (not in the watchdog log).

But now, the user does only see the technical name on the password reset page. This is confusing.

Proposed resolution

Use \Drupal\user\UserInterface::getDisplayName()

Comments

SwapS created an issue. See original summary.

hardikpandya’s picture

Assigned: swaps » hardikpandya
hardikpandya’s picture

Assigned: hardikpandya » Unassigned
shashikant_chauhan’s picture

Assigned: Unassigned » shashikant_chauhan
shashikant_chauhan’s picture

Status: Active » Needs review
StatusFileSize
new45.24 KB

Adding patch.

Status: Needs review » Needs work

The last submitted patch, 5: getDisplayName-2801645-5.patch, failed testing.

shashikant_chauhan’s picture

Status: Needs work » Needs review
StatusFileSize
new1.32 KB
new44.84 KB

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

duaelfr’s picture

Thank you for your contribution. Beware of duplication with #2629286: Use getDisplayName() for user names consistently, though.
I'm not confident enough to decide which of your issues should be closed in favor of the other. Could you have a look there and see how you can converge?

Lassay’s picture

Thank you for your contribution. It does exactly what I needed and it seems to work perfectly fine.

hass’s picture