Problem/Motivation

When cancelling an account, the only option to reassign content is to the anonymous account.

Proposed resolution

Add the ability to specify a user content will be reassigned.

User interface changes

tbd

Data model changes

tbd

Original report by hctom

Hi @all,

I'm not sure, if I'm too late for the API changes feature request, but I think it would be quite useful to tweak the "Delete the account and make all content belong to the Anonymous user." method for cancelled accounts.

It would be great to have an autocomplete field, too choose the user the content is reassigned to instead of always using the anonymous user. If the field is left empty, a default value should be used. This may either be the anonymous or a configurable setting value should be available for this.

Of course, this tweak for method may only be available to privileged users (e.g. with "Administer users" permission or even an own permission for this selection), so non-admin users with the "Select method for cancelling own account" may not reassign contents to other users by default (as this may be abused).

With this tweak site administrators may be able to set up a special account like "Deleted person" to reassign the content to. The may also reassign contents to the correct user, when two accounts need to be merged by cancelling one of them.

The corresponding uid may be transferred to hook_user_cancel() via the $edit parameter, so there is no need to change the hook's function signature. Only the performed queries need to be altered slightly to use the passed uid instead of 0.

So... what do you think about this proposal?

I'd appreciate, getting feedback for this.

Thanx in advance & cheers

hctom

Comments

mrfelton’s picture

subs.

ilo’s picture

Just to mention that with current user cancel API it can be done in a contrib module..

Damien Tournoud’s picture

Version: 7.x-dev » 8.x-dev

Drupal 7 has long been featured frozen.

jhedstrom’s picture

Version: 8.0.x-dev » 8.1.x-dev

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

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

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dpi’s picture

Title: Enable user defined reassign target when a user account is cancelled » Allow admins to specify which account the content for a cancelled user is assigned
Issue summary: View changes

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.

Jieyyal’s picture

Hi @hctom

There is already a contrib module available for D7.
https://www.drupal.org/project/move_user

Port to Drupal 8 is almost done.
https://www.drupal.org/node/2693353

Check more detail on github.
https://github.com/ciandt-china-dev/hackathon-drupal8-move_user

Thanks

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

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

Version: 8.5.x-dev » 8.6.x-dev

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

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dpi’s picture

Issue tags: -cancel +user cancellatiom
dpi’s picture

Issue tags: -user cancellatiom +user cancellation
dpi’s picture

I think this issue would also solve the feature request to merge users. Per #2040139: Allow users to be merged

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Anybody’s picture

I really really don't like Wordpress, but they have this option! And it's VERY handy if for example an employee leaves the company and another one takes his position, which isn't that untypical...

So +1 for an option to allow selecting a user to reassign contents when deleting an account instead of removing the user (assign to Guest). Overdue since Drupal 6, I guess? ;) (no offense, I didn't implement it either ;))

Also agree with #16, at least for all affected contents!

As VBO for example already has options to batch (re)assign entities ownership, it might make sense to generalize these functionalities into 10.x core?

I know this by far isn't as simple as it sounds, but I guess it's kind of base functionality for a mature CMS?

Anybody’s picture

Issue tags: -D7UX usability

Removing Drupal 7 tag. @dpi should we perhaps change the Core version to 10.x? Would it make sense to discuss this in core team then?

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.