diff --git a/includes/comment.inc b/includes/comment.inc index 84d46ae..616a83d 100644 --- a/includes/comment.inc +++ b/includes/comment.inc @@ -543,6 +543,8 @@ function project_issue_comment_view(&$node, $comment = NULL) { * An object representing the comment data used to update the issue. */ function project_issue_update_by_comment($comment_data, $op) { + global $user; + switch ($op) { case 'insert': // Massage the incoming data so the structure is consistent throughout the function. @@ -575,9 +577,19 @@ function project_issue_update_by_comment($comment_data, $op) { $node = node_load($comment_data->nid, NULL, TRUE); // Don't use cached since we changed data above. $node->title = $comment_data->title; + // Prevent node revision author from being changed. + // @see node_save(), _node_save_revision() + $original_user = $user; + session_save_session(FALSE); + $user = user_load($node->uid); + // This also updates the changed date of the issue. node_save($node); + // Restore original user. + $user = $original_user; + session_save_session(TRUE); + // Return the object of comment data we used to update the issue. return $comment_data; }