Hi Christoph,

Would you be able to release a new version of comment.module.dp5 that is based on the new comment.module that comes with Drupal 5.3? It's my understanding that the comment.module was updated somewhat (at least one security vulnerability was quashed) with the new release.

Here are the updates to comment.module in Drupal 5.3 (all the ones I could find, anyway):

http://drupal.org/node/184354
http://drupal.org/node/180559
http://drupal.org/node/63990
http://drupal.org/node/183390

I need to upgrade my site for security reasons, but I don't want to lose the functionality provided by Comment Notify (thanks for an awesome module, by the way). I've struggled to look at the code, but I'm a novice at PHP and the logic of your modifications is not immediately apparent to me.

BTW - I suppose it's possible that your gripes with the existing comment.module have been addressed with this new release.

Thanks again.

CommentFileSizeAuthor
#5 comment_notify_patch_to_comment.patch693 bytesgreggles

Comments

WildBill’s picture

Status: Active » Patch (to be ported)

Okay, I just added the else function described at the node below to the new v5.3 comment.module, and it seems to be working fine now.

http://drupal.org/node/156475

junyor’s picture

It would be much, much better if this module included a patch for the core module rather than a drop-in replacement for the core module, especially if it isn't actively maintained.

ablivio’s picture

To clarify things: the file comment.module.dp5 is based on the comment.module published with Drupal 5.1:
$Id: comment.module,v 1.520.2.1 2007/01/23 19:11:43 dries Exp $

The patch is pretty simple. In the comment_save() function, the following section:

      if ($status == COMMENT_NOT_PUBLISHED) {
        drupal_set_message(t('Your comment has been queued for moderation...[truncated]
      }
      return $edit['cid'];

has an additional 'else' clause:

      if ($status == COMMENT_NOT_PUBLISHED) {
        drupal_set_message(t('Your comment has been queued for moderation...[truncated]
      }
      else
      {
        comment_invoke_comment($edit, 'publish');
      }

Therefore, it's pretty easy to patch yourself the latest version of comment.module:

  • you find the "COMMENT_NOT_PUBLISHED" string
  • you add the else { comment_invoke_comment($edit, 'publish'); } line just before the return $edit['cid'];
  • you're done!
  • By the way, this modification has been committed in Drupal 6. :-)

greggles’s picture

Status: Patch (to be ported) » Needs review

Junyor - I agree with you that a patch is better than the whole file.

I think this is still active, right? I've attached a patch based on the file I'm using. If this looks good I'll add it to the DRUPAL-5 branch.

greggles’s picture

StatusFileSize
new693 bytes

with attachment...

greggles’s picture

This will require an update to the INSTALL.txt and project page when that happens to mention using the patch instead of the whole file.

greggles’s picture

Category: support » bug
Status: Needs review » Fixed

Ok, fixed. Thanks for the ideas, folks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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