Closed (fixed)
Project:
Node Comments
Version:
6.x-3.x-dev
Component:
Code
Priority:
Critical
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
27 Jan 2011 at 04:59 UTC
Updated:
30 Nov 2012 at 13:20 UTC
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
Comment #1
crea commentedOne 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.
Comment #2
crea commentedSee #1175348: Node Comments doesn't react on user delete events
Comment #3
crea commentedHm, 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.
Comment #4
crea commentedComment #5
crea commentedComment #6
crea commentedIn 3.x I removed comment conversion completely. So we may need to deal with orphans somehow.
Comment #7
crea commentedComment #8
crea commentedOne 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.
Comment #9
crea commentedComment #10
crea commented2.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.
Comment #11
crea commentedWe have better db durability now...hopefully