Problem/Motivation
At the moment every content entity type must implement hook_user_cancel()
to do updates when a user is cancelled. We have comment_user_cancel()
and node_user_cancel()
but we are missing implementation for other Core Entities, including: taxonomy_user_cancel()
, file_user_cancel()
and media_user_cancel()
. We need to handle both user_cancel_block_unpublish
and user_cancel_reassign
.
Also we have node_user_predelete()
and comment_user_predelete()
that will delete all the nodes and comments if the user is deleted. We might need something generic for that too.
In addition, many custom/contrib Content Entity Types likely have missing or incomplete implementations of the relevant hooks to properly react when a user is cancelled.
Proposed resolution
It has been decided to provide a generic solution using a Entity Handler dedicated to reacting on the cancelation a user.
The proposed handler will support each option that the administrator has for cancelling a user (mainly deleting all associated content or making that content anonymous). Additionally a implementation will also be provided which will support batch processing.
Each Content Entity Type will have to add this new handler to their Entity Type Annotation, developers can take advantage of the handlers provided by core, or can extend those handlers to define their own custom functionality. The latter is not required for custom Entity Types and the handlers provided will work with custom Entity Types.
Remaining tasks
- Continue to refine the proposed resolution and review associated patches.
- Framework manager decision is required on which namespace these new handler classes should use, see #39.
User interface changes
@todo - perhaps the user cancel form should give more indication of how many and what entities are going to be affected.
API changes
- Modifications to User module to provide new handlers.
- Modifications to some core modules to replace the usage of
hook_user_cancel()
with these new handlers.
Data model changes
No data model changes.
Release notes snippet
TODO.