Hi,

I can't get the content_thread subscription type to work; that is, I can't get notifications to trigger an event when new comments are posted in a thread the user subscribes to.
After a bit of investigation, I believe this is because the two action hooks (notifications_content_comment_insert_action & notifications_content_comment_update_action) are empty.. Is this intentional?

I haven't tried putting in a body like the ones from the node action hooks - that is, something (simplified) like the following - to see if that solves the problem. Mostly because I'm fairly new to the notifications code..

function notifications_content_comment_insert_action($node, $context = array()) {
  notifications_content_node_event('comment', $node)->trigger();
}

Anyways - my questions are just "is this a known problem?" and "what can I do to help?"

Regards
Morten

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

spacereactor’s picture

I facing same problem, all the comment unable to trigger email send. Please can some help to make a patch to fix this.

webflo’s picture

Category: support » bug
Status: Active » Needs review
FileSize
1.88 KB

Here is a patch. Please review. Make sure that your configured the triggers.

webflo’s picture

Slightly better patch.

sharplesa’s picture

Status: Needs review » Needs work

Proposed test methodology

Proposed procedure to verify the problem:

  1. Install and configure notifications and messaging.
  2. Make sure you have "View comments" permission @ admin/people/permissions.
  3. Make sure you are receiving the messages yourself. At admin/config/messaging/notifications, check "Notify poster of own posts"
  4. Make sure comment changes trigger Notification events @ admin/structure/trigger/comment. This is on the Comment tab, not the Node tab. Look for "Trigger: After saving a new comment", and for "Trigger: After saving an updated comment", and attach the available notification event to each.
  5. Create a node you can subscribe to.
  6. Create a subscription to the node (e.g., @ notifications/subscription/add/content_thread).
  7. Post a comment on the node you're subscribed to.
  8. Verify that no notifications are triggered. E.g., admin/reports/dblog has no entries for notifications for the comment you posted.

Proposed procedure to verify the fix:

  1. Apply the patch (patch notifications_content/notifications_content.inc comment-subscription-not-working-1084802-5-D7.patch)
  2. "Clear all caches" @ admin/config/development/performance
  3. Create a new comment on the node that you're subscribed to.
  4. Verify that notifications were triggered.

Results: SUCCESS

I followed the procedures described above, and received notification for comments.

EDIT 2011-08-31: Revised procedure for correctness and new patch and new result.

webflo’s picture

Make sure that the user has the "view comments" permission. Rerolled the patch and made a screenshot to show the trigger configuration. It is comment trigger not node.

sharplesa’s picture

Status: Needs work » Reviewed & tested by the community

Webflo, you're a genius! I completely overlooked the "comment" tab on the triggers page.

So, I revised the procedure at #4, ran it, and got notification!

Changing state to "reviewed and tested".

Thanks

Dane Powell’s picture

Patch seems to work, but I do have one thought: shouldn't this action be enabled by default, just like the equivalent actions on the node tab?

webflo’s picture

Status: Reviewed & tested by the community » Fixed

Good catch. Fixed in Commit 1d08ce4 and 7a404f8 on 7.x-1.x.

Jesuscares’s picture

@sharplesa: Thank you for your steps you provided in comment #4 above. I was able to follow them and found that my comments were not working because I had not enabled the triggers.

I would like to add one note: There is a single trigger available titled "Trigger: When either saving a new comment or updating an existing comment", DO NOT use that one. I looked at it as a shortcut and realized that there is no value in the drop down for a trigger that says "Send notifications for comment (if published)" there. You need to add the trigger separately for "Trigger: After saving a new comment" and "Trigger: After saving an updated comment." Do this by selecting "Send notifications for comment (if published)" from the dropdown and clicking "Assign" for each of these two triggers. I didn't need to install the patch. Once I set those triggers and tried a comment, it worked! Thanks!

Status: Fixed » Closed (fixed)

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