I'm testing version 6.x-1.4 and I believe set up all the permissions and configuration correctly. When I edited a comment as a regular authenticated user (not user #1), no update was being logged to the database and thus no message being appended to the comment (or added to the template with that config option set).

I looked at the code and i think it has to do with line 101:

    // User 1 automatically does silent edit.
    // Do not log comment change where its just being unpublished.
    if ($previous->status != $comment['status'] && $user->uid != 1) { // User 1 does silent edits.

Shouldn't it be

  if ($previous->status == $comment['status'] && $user->uid != 1) { // User 1 does silent edits.

or even

  if ($previous->status == $comment['status'] && $comment['status'] == COMMENT_PUBLISHED && $user->uid != 1) { // User 1 does silent edits.

It's VERY possible I'm missing something obvious but when when I change the code I get the behavior I would expect.

Thanks!

Comments

foutrelis’s picture

Yeah, I noticed the same when I updated comment_edited to 1.4.

I can't provide more insight than what you have, but thank you for mentioning the possibly problematic code. Changing that conditional to an equality produces the expected behavior for me too.

twiik’s picture

You're not missing something.

I downloaded the latest dev and that line is still in there.

Just like in hook_nodeapi the 'update' $op in hook_comment is after the comment has been updated in the database so $previous and $comment will always be the same and thus the check can never return true.

This module doesn't work and I don't understand how such a blatant bug can exist for years in such a simple module.

snufkin’s picture

"This module doesn't work and I don't understand how such a blatant bug can exist for years in such a simple module."

First of all this module hasn't even been around for years.

Second, please instead of criticising try to submit a patch. I don't have free time to debug, test and fix this. If you step up and provide a patch that fixes the issue then I would be happy to commit it. You seemed to have traced down the issue, feel free to read up on http://drupal.org/patch.

snufkin’s picture

Version: 6.x-1.4 » 6.x-1.x-dev
Status: Active » Fixed

This is now fixed in dev. Once #988808: Latest release breaks $comment->comment_edited in Advanced Forum 2.x is resolved i'll roll a new stable release.

Status: Fixed » Closed (fixed)

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