Node Comment does not set a node's comment statistics to the correct value. The current behavior is that the node comment statistics (number of comments for a node) is set to the total number of comments for a node, both published and unpublished.
The query which currently determines the number of comments is:
SELECT COUNT(*) FROM {node_comments} nc INNER JOIN {node} n ON n.nid = nc.nid WHERE nc.nid = %d AND n.status = 1
This result of this query is the number of comments for a published node.
The query should instead count the number of published comments for a node:
SELECT COUNT(*) FROM {node_comments} nc INNER JOIN {node} n ON n.nid = nc.cid WHERE nc.nid = %d AND n.status = 1
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | nodecomment.issue701970-20100307.patch | 688 bytes | iva2k |
Comments
Comment #1
prabhakarsun commentedIn which file I need to change it?
Comment #2
iva2k commentedHere's a patch based on #1. Please review and report here.
Comment #3
prabhakarsun commentedIt Works.
Comment #4
crea commentedThanks, commited.