Describe the bug
Trying to delete an existing user fails with Cannot delete user because of content relational constraints.
To Reproduce
Steps to reproduce the behavior:
Cannot delete user because of content. relational constraints.Cannot delete user because of content. relational constraints.Expected behavior
At Step 6. one should be able to delete someuser as all content by that user is removed.
Screenshots
See below.
Host Info (please complete the following information):
Additional context
I checked the database for any references to the authorId of the user someuser and found an entry in pageHistory for the page somepage. My guess is that in the moment someuser deletes his page somepage this entry is created and now referencing the authorId of someuser which leads to the error when trying to delete that user.
After deleting the entry in pageHistory manually i was able to delete user someuser in the admin backend.
I thinks it is kind of a dilemma, not having an entry in pageHistory on deletion of pages interferes with restoring that page later i guess. So i think the long term best solution is to implement an authorship-transfer systems on user deletion where that authorId gets replaced all over the db. See request https://requarks.canny.io/wiki/p/transfer-authorship-of-pages
Trying to delete someuser

Deleting all content created by someuser (somepage)

Trying again to delete someuser




Fixed by 1f9e5b3fd0e8329189f1eb9615465e78f42a98c2
A target user can now be selected where all content will be reassigned before deletion.
Most helpful comment
Fixed by 1f9e5b3fd0e8329189f1eb9615465e78f42a98c2
A target user can now be selected where all content will be reassigned before deletion.