Deprecate hook_user_format_name_alter()

Created on 25 September 2015, about 10 years ago
Updated 20 August 2025, 2 months ago

Problem/Motivation

This is mostly a follow-up to #2112679: getUsername() should return the username getDisplayName() for the formatted user name β†’ where some minor consensus was reached about removing hook_user_format_name_alter(). See: https://www.drupal.org/node/2112679#comment-10356635 β†’

This comes about because we let contrib change the user name through hook_user_format_name_alter() for reasons that have a lot of down-side and not a lot of up-side, mostly inherited from the time before there were fieldable user entities.

Proposed resolution

Remove hook_user_format_name_alter() and keep the account name as something only core can touch.

Remaining tasks

  1. Cogitate.
  2. Confab.
  3. Consense.
  4. Commit.

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

user system

Created by

πŸ‡ΊπŸ‡ΈUnited States mile23 Seattle, WA

Live updates comments and jobs are added and updated live.
  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024