I'll need to investigate this more.

CommentFileSizeAuthor
#4 dontclobberthosecomments.patch1.26 KBWesley Tanaka

Comments

Wesley Tanaka’s picture

I can reproduce the bug when editing the comment as the uid=1 account, as well as the comment owner (non-privileged). The date shows up as correct in the preview, but saves into the database incorrectly (as 0)

Wesley Tanaka’s picture

Seems to be another case of "it wasn't in the form," so an unset value starts getting around.

The culprit seems to be this line:

        db_query("UPDATE {comments} SET status = '%s', timestamp = %d, subject = '%s', comment = '%s', format = '%s', uid = %d, name = '%s' WHERE cid = %d", $edit['status'], $edit['timestamp'], $edit['subject'], $edit['comment'], $edit['format'], $edit['uid'], $edit['name'], $edit['cid']);

In this case, I'm guessing that !issset($edit['timestamp']) holds true.

Wesley Tanaka’s picture

Out of all the $edit indices referred to in the update statement, 'status', 'timestamp', 'format' and 'name' aren't set by default.

Wesley Tanaka’s picture

Status: Active » Needs review
StatusFileSize
new1.26 KB

Patch attached. This seems like a reasonable way to deal with the issue.

asimmonds’s picture

Status: Needs review » Active

I've reopened http://drupal.org/node/35726, as this bug is a result of that issue, and I screwed up.
Can followups be directed to http://drupal.org/node/35726

chx’s picture

Status: Active » Closed (duplicate)
Wesley Tanaka’s picture

Status: Closed (duplicate) » Needs review

Reopening. See http://drupal.org/node/35726#comment-56652 for reasoning.

Wesley Tanaka’s picture

Status: Needs review » Closed (duplicate)

since been rolled into the patch 35726_1.patch on http://drupal.org/node/35726

Wesley Tanaka’s picture

and since re-split into a separate issue.

http://drupal.org/node/40762