Deleting a comment author while the Comment module is disabled leads to an EntityMalformedException error after it's reenabled

Created on 22 February 2012, almost 13 years ago
Updated 26 May 2023, over 1 year ago

I ran into an unfortunate bug with the Comment module. Steps to reproduce:

  1. Create an article as the admin user.
  2. Log in as a regular user and leave a comment on the article.
  3. Log back in as the admin, disable the Comment module, delete the regular user, and then turn the Comment module back on again.
  4. Visit the node, and you get a nice fatal EntityMalformedException error.

The issue is that while the Comment module is disabled, its hooks (for user deletion) cannot run, so it can't delete the comment, and an orphaned comment is left over. (Similar orphaned comments occur if you delete a node while the Comment module is disabled, but in that case I'm not currently aware of any visible side effects; maybe you can get some with Views though.)

I debated between "normal" and "major" for this issue. It takes an odd set of steps to reproduce, but if you do find yourself in this situation you have broken nodes on your site and no way to repair them. I went with "major" for now.

Patches will follow in a second.

🐛 Bug report
Status

Fixed

Version

7.0 ⚰️

Component
Comment 

Last updated about 19 hours ago

Created by

🇺🇸United States David_Rothstein

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024