After I've deleted a comment from a node (nid=11) the node_comment_statistics got all-0 entry:

 SELECT * from node_comment_statistics WHERE nid=11;
 nid | last_comment_timestamp | last_comment_name | last_comment_uid | comment_count 
-----+------------------------+-------------------+------------------+---------------
  11 |                      0 | 0                 |                0 |             0
(1 row)

This does not seem to be correct

Comments

Cvbge’s picture

StatusFileSize
new1.58 KB

Here's a patch for the '0' in last_comment_name. The '0' was inserted while '' should be.

Now the question is: are the '0' in last_comment_timestamp allowed? Normally, when a node does not have any comments, the node created timestamp is kept.

Cvbge’s picture

Status: Active » Needs review

The previous patch changed also some NULL to 0.

Cvbge’s picture

StatusFileSize
new1.64 KB

The function comment say:

 * - last_comment_timestamp: the timestamp of the last comment for this node or the node create stamp if no comments exist for the node.
 * - last_comment_uid: the uid of the poster for the last comment for this node or the node authors uid if no comments exists for the node.

Here's a patch that sets the timestamp and uid correctly.

Cvbge’s picture

Status: Needs review » Reviewed & tested by the community

Let's set this to RTBC and see what happens ;)

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)