The following query:

SELECT * FROM node_comments

returns more queries than

SELECT * FROM node WHERE type="comment"

I don't know exactly when this started, but I've had node_comments for a while and never had this problem... It doesn't create any errors in drupal core or node_comments that I'm aware of, but it totally destroyed some custom code I had on my front page, and is something that should be addressed - is it a problem to do with node_comments.

Comments

crea’s picture

One of the possible sources of inconsistency I discovered is that Node Comments doesn't have hook_user() implementation thus it doesn't update own table with when user is deleted.

crea’s picture

crea’s picture

Hm, user delete stuff doesn't affect number of rows.
Is it for freshly installed module or did you have previous versions installed ? I can't say anything about previous ones. This module has a very long history, and lots of bugs fixed in the process.

crea’s picture

Status: Active » Postponed (maintainer needs more info)
crea’s picture

Version: 6.x-2.0-beta6 » 6.x-2.x-dev
crea’s picture

Title: Orphaned rows in node_comments » Orphaned comments.
Version: 6.x-2.x-dev » 6.x-3.x-dev
Category: bug » task

In 3.x I removed comment conversion completely. So we may need to deal with orphans somehow.

crea’s picture

Status: Postponed (maintainer needs more info) » Active
crea’s picture

Priority: Critical » Major

One more source of DB inconsistency: node comments were deleted via node_delete() which checks delete permissions. That means user deleting own comments most likely didn't fully delete children comments because of lack of the permission. Need to decide what to do with these nodes.

crea’s picture

Priority: Major » Critical
crea’s picture

Priority: Major » Critical

2.x was such a shame...it was full of bugs and poor architecture.
Ok, the module now deletes "node_comments" table entries one by one, only together with the node. This itself should increase durability: in case mass delete fails, you only get max 1 broken node/comment.

Another thing I implemented is a custom delete function. It doesn't check for delete permissions so when user deletes his own comments, child comments are properly deleted (same way core comment module does). It also allows to veto deletion via custom hook, and also to prepare for delete operation via another hook, if nodeapi "delete" operation is too late. In terms of this issue we only care that it doesn't leave orphans.

crea’s picture

Status: Active » Fixed

We have better db durability now...hopefully

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.