Site co-admin ignorantly deleted a user. Now all nodes referring to that user became inaccessable, and even the root admin could not remove them. I had to restore the user manually in phpMyadmin.

If they are blocked from viewing and editing, what would be against it to delete them in one go together with the user (after a warning)?

Because the nodes are still present in a crippled manner, some modules become that as well. I did not check all node / user related modules, but at least the statistics module incorrectly showed a node of a deleted user: only the title appears but when you click it access is denied.

Comments

moshe weitzman’s picture

ñull’s picture

Title: User deleted - nodes "crippled" » User deleted - nodes still "crippled", NOT deleted!
Version: » 4.6.3
Priority: Normal » Critical
Status: Closed (duplicate) » Active

Something has set this to Duplicate. I did not find the duplicate and the issue is still valid:

I created a new user "test" with uid 3
Made new story node promoted to the frontpage with that user
I deleted the user
Then the frontpage gave the notice "n/a" where the story should appear.
I restore the user with the correct uid 3.
Then the story on the frontpage is restored as well.

Conclusion: contrary to the promise in the warning that appears before user delete is confirmed, the nodes that belong to that user are NOT deleted, leaving behind quite a mess of nodes without a user.

PeterLucas’s picture

Developers have explained to me "it's not a bug but a feature". Drupal decides for you that it's rude and unnecessary to delete old posts. They have to be preserved for posterity or something. I don't get it...

ñull’s picture

Then they should take away the delete button. As long as the button is there, it remains a bug.

ñull’s picture

Version: 4.6.3 » x.y.z

In the present CVS I checked it again and now the user is simply not deleted, without explanation. It seems to be moving in the direction PeterLucas is suggesting.

I think that it should be possible to delete a user account, especially when the user requests for it. I think it is even a right according to European law that you can revoke personal information and I think the email address is that too. I would therefore be great when the Delete button is restored to its original meaning, or there should be an alternative. I will start another thread for that somewhere.

ñull’s picture

Status: Active » Closed (duplicate)

User and content can be deleted when you go to profile (clicking the user in the userlist) -> Edit -> Delete.

This is a duplicate of issue http://drupal.org/node/19750

ob3ron’s picture

Status: Closed (duplicate) » Active

I would like to confirm that this is a bug, and is not a duplicate of http://drupal.org/node/19750.

I created a user, made a posting in an empty forum with that user, then deleted the user.

The forum then showed one new post, but when opened the forum was empty. The node created with that user also wasn't accessible on the administer/content page.

When I reinstated the user through phpMyAdmin, the post in the forum was back, and was also visible in administer/content. I deleted the node, then deleted the user, and all was fine.

However, the expected behaviour ("Deleting a user will remove all their submissions as well. This action cannot be undone.") did not work as expected -- the user's nodes were not deleted.

Note that I deleted the user with admin->list of users->edit user->delete; I didn't try other methods of deleting. And I'm using Drupal 4.6.5, so I'm not sure if this has been fixed in cvs.

puregin’s picture

This is definitely a bug.

The UI for deleting a user (in the delete confirmation dialogue) reads

"Deleting a user will remove all their submissions as well. This action cannot be undone."

Looks like we're calling

module_invoke_all('user', 'delete', $edit, $account);
on line 1354 of user.module, but it doesn't look like this actually invokes
any hooks that I can see.

Should there be a node_user() hook to deal with this?

There is disscussion of this also in http://drupal.org/node/8

m3avrck’s picture

Status: Active » Closed (duplicate)

This is really a duplicate of: http://drupal.org/node/8

Reason being, deleting a user tied to content is a lot more tricky than just deleting the user. Many times a user should be deleted and content should be left. Sometimes not. The system really needs to flexible. It's been broken for quite sometime.

Let's focus on the patch in #8, it's pretty darn close, I'll bug Simon to post an updated patch. Then we can work on the hooks like puregin has suggested.