You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It has been discovered that if a user account got deleted while the comment module was disabled, the comments of these accounts aren't handled properly. As the module was disabled, the hooks didn't run (hook_user_predelete, hook_user_cancel).
The problem arises when re-enabling the comment module - either in broken comments (comment entities without uid of an existing user can't get loaded), or in comments still showing up although they should have been unpublished.
Steps To Reproduce
To reproduce the behavior:
disable comment module
delete a user (or cancel with unpublishing content) who has commented
enable comment module
Additional information
Several suggestions have been made.
delete orphaned comments in hook_enable when uid doesn't exist
reassign orphaned comments in hook_enable when uid doesn't exist
run module hooks regardless of the fact the module is disabled (might be impossible)
provide some sort of UI for admins to handle leftover data
We should now figure out what we consider proper handling of orphaned data.
The text was updated successfully, but these errors were encountered:
@indigoxela, thanks for creating the issue. I do believe when user is getting deleted there is a db query that deletes relevant comments only if the Comment module is enabled. So if that condition was changed so it deletes the user's comments regardless if the module is enabled or disabled, then we will save the DB from lot's of orphaned content.
Description of the bug
This is a follow-up Issue of #4426
It has been discovered that if a user account got deleted while the comment module was disabled, the comments of these accounts aren't handled properly. As the module was disabled, the hooks didn't run (hook_user_predelete, hook_user_cancel).
The problem arises when re-enabling the comment module - either in broken comments (comment entities without uid of an existing user can't get loaded), or in comments still showing up although they should have been unpublished.
Steps To Reproduce
To reproduce the behavior:
Additional information
Several suggestions have been made.
We should now figure out what we consider proper handling of orphaned data.
The text was updated successfully, but these errors were encountered: