I'd like to make some changes to a new comment programatically. I'm using the following code:
function MYMODULE_comment_presave($comment) {
$user = user_load($comment->uid);
$uid = $user->uid;
// if ($comment->is_new) {
$comment->field_image['und'][0]['fid'] = $user->field_image['und'][0]['fid'];
}
// }
}
I don't know how I can check whether the comment that's about to be saved is new or edited. $comment->is_new
doesn't work.
How can I solve this?