When rebuilding comment statistics in the case were a node has no comments migrate uses the last modified date of a node. However _comment_update_node_statistics() uses the creation date of a node.

For me this is affecting a forums migration.

CommentFileSizeAuthor
#3 1799854.patch760 bytesJeremyFrench
#1 1799854.patch692 bytesJeremyFrench

Comments

JeremyFrench’s picture

Status: Active » Needs review
StatusFileSize
new692 bytes

Patch attached to fix this.

Status: Needs review » Needs work

The last submitted patch, 1799854.patch, failed testing.

JeremyFrench’s picture

Status: Needs work » Needs review
StatusFileSize
new760 bytes

use CLI rather than Eclipse to make patch.

moshe weitzman’s picture

Perhaps it used to be modification date in D6? Perhaps you could take a look so we know fithis is safe to backport. Thanks.

JeremyFrench’s picture

Hi Moshe
_comment_update_node_statistics()
Still looks like it was 'created' in D6

// no comments
  else {
    $node = db_fetch_object(db_query("SELECT uid, created FROM {node} WHERE nid = %d", $nid));
    db_query("UPDATE {node_comment_statistics} SET comment_count = 0, last_comment_timestamp = %d, last_comment_name = '', last_comment_uid = %d WHERE nid = %d", $node->created, $node->uid, $nid);
  }

so backport should be ok.

mikeryan’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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