Skip to content

Instantly share code, notes, and snippets.

@SupermanScott
Created June 3, 2010 20:58
Show Gist options
  • Save SupermanScott/424472 to your computer and use it in GitHub Desktop.
Save SupermanScott/424472 to your computer and use it in GitHub Desktop.
diff --git a/html/sites/all/modules/contrib/notifications/notifications_content/notifications_content.module b/html/sites/all/modules/contrib/notifications/notifications_content
index 3628cff..38232c8 100644
--- a/html/sites/all/modules/contrib/notifications/notifications_content/notifications_content.module
+++ b/html/sites/all/modules/contrib/notifications/notifications_content/notifications_content.module
@@ -726,9 +726,13 @@ function notifications_content_nodeapi(&$node, $op, $arg = 0) {
function notifications_content_comment($comment, $op) {
// $comment can be an object or an array.
$comment = (object)$comment;
+ static $update_published_before = FALSE;
+ if ($op == 'update') {
+ $update_published_before = $comment->status == 0;
+ }
if ($op == 'publish' && empty($comment->notifications_content_disable) && notifications_event_enabled('node-comment') &&
- (!isset($comment->notifications_comment_status) || !empty($comment->notifications_comment_status)) ) {
+ !$update_published_before ) {
// Check that the node is published and comment notifications are enabled for this node type
$node = node_load($comment->nid);
if ($node->status && notifications_content_type_enabled($node->type)) {
@@ -971,4 +975,4 @@ function notifications_content_comment_access($comment, $account) {
)
// But all that if and only if the user can access the node too
&& notifications_object_access('node', $comment->nid, $account);
-}
\ No newline at end of file
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment