Option to keep realname in DB when a user is deleted

Created on 13 November 2024, 10 days ago

Problem/Motivation

Some projects might need to keep the uid-realname record as an artifact of the user being deleted.

A potential use case could be the to show the author real name on content that the deleted user has authored, even the user account has been deleted. We have such a case on one of European Commision projects, where we want to keep the content correctly authored with the real name of the author but we cannot keep the account blocked if they want to cancel because GDPR is not allowing us to store user data against their consent. But I can imagine many other cases.

Workaround

Even without this option it's possible to achieve the goal by implementing hook_module_implements_alter() and make realname_user_delete() ineffective. But a more streamlined solution could be implemented in the module.

Proposed resolution

  • Add a new configuration realname.settings:delete_realname (bool) and only delete the realname entry if this config is true.
  • Default to FALSE in default config and provide a post-update function to set it to FALSE for existing site so we don't berak the current behaviour.
  • Update RealnameAdminSettingsForm to expose the new setting.

Remaining tasks

None.

User interface changes

Site builders ca decide to not delete realnames on user account at /admin/config/people/realname

API changes

None.

Data model changes

New config: realname.settings:delete_realname (bool)

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇷🇴Romania claudiu.cristea Arad 🇷🇴

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024