Please can we have the ability to choose which user content gets reassigned to. I have several users that I wish to delete, but I don't want any of their content assigned to the Anonymous user like this module wants to do. Instead, I want to be able to select the user that should become the new owner of any reassigned content.

Comments

alliax’s picture

If it's always the same user you want to assign the content to, then you could edit in the module directly, in the function user_delete_submit() at line 145:

// reassign content
      db_query("UPDATE {node} SET uid = 0 WHERE uid = %d", $uid);
      db_query("UPDATE {comments} SET uid = 0 WHERE uid = %d", $uid);

Simply replaces uid = 0 by the user id of the one you want. 0 is the anonymous user.

If you want to select different users from a list, then changes to the modules are going to be too complicated for my skills, unfortunately.

sashainparis’s picture

Code has changed: this 2 lines no longer exist.
How can we now modify the reassigned user?

dotidentity’s picture

Any updates on this?

dkingofpa’s picture

sub

ilo’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

Lets keep 6.x-1.x as it is and moving feature requests for 2.x branch, this way we can introduce features as additional module that can be ported to d7 also.

derhasi’s picture

Version: 6.x-2.x-dev » 6.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new5.05 KB

I did a patch for this issue for the 6.x-1.x- Branch. (Applied it against 1.3).
The patch is attached.

I'll try to implement this in the 2.x-branch as well, but as that branch seems not to be stable at the moment, we decided to patch 1.x instead. So for the moment I set this issue back to 1.x.

Status: Needs review » Needs work

The last submitted patch, user_delete-614940.patch, failed testing.

derhasi’s picture

StatusFileSize
new4.72 KB

Oh, ok, modified the source and destination folders...

derhasi’s picture

Status: Needs work » Needs review
derhasi’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
StatusFileSize
new6.64 KB

The above patch (#8) was applied to 6.x-1.x-dev.

And here is the 6.x-2.x-dev Version of the same functionality.

Status: Needs review » Needs work

The last submitted patch, user_delete-6.x-2.x-614940.patch, failed testing.

derhasi’s picture

Status: Needs work » Needs review
StatusFileSize
new6.64 KB

Hm... crazy... fixed line endings... should now work.

ilo’s picture

Thanks derhasi for working on this. I'll take a look to the 2.x patch and see if there are additional changes to include.

tobiberlin’s picture

StatusFileSize
new2.59 KB

I applied the above patch and got an error when "Userpoints Nodes and Comments" is enabled:

Fatal error: Cannot use object of type stdClass as array in ...\sites\all\modules\userpoints_nc\userpoints_nc.module on line 246

I attached the module file where you can find this line - it belongs to a bigger function which may be important for you to see what happens there.

Best,
Tobias

derhasi’s picture

@tobiberlin, I guess this is a problem in userpoints module, that tries to use a user-object that does not exist or is malformatted.

Besides:
I wrote a patch in addition to comment #8 (for 6.x-1 branch) to support reassign content AND unpublish it. I upload it here only for people who might be interested in the same functionality for v1.

Status: Needs review » Needs work

The last submitted patch, 614940-reassign-and-unpublish.patch, failed testing.