Download & Extend

New comment triggers notification containing node text not comment text

Project:Subscriptions
Version:5.x-2.5
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hi. The symptom I'm seeing sometimes (but not all the time) is when a person posts a comment on a node, an email notification is sent out containing the original node text rather than the comment text. As a result, the members think it's a duplicate post.

Most of the time, the new comments are sent out as emails. I see these duplicate emails about 1 in 5 times.

Any ideas what could be the problem?
Chris

Other information:
* People's subscriptions are set to "on update" and "on comment"
* OG groups subscriptions are being used.
* My mail template looks like this:

{{!is_old==1?:!node_type Post by !sender_name:

}}
{{!is_old==1?:!body}}{{!has_new_comments==1?!comments:}}
| Post Reply: !url

| --------------------------------------------------------------------
| This is an automated message for !recipient_name.
|
| Please do NOT reply to the sender address!
| To manage your subscriptions go to
| !manage_url
|
| Direct unsubscribe link (!subs_type):
| !unsubscribe_url

Comments

#1

No, I've never heard of such a problem.

The template that you're showing seems to be the node/nid template. Which one is used when you get the node instead of a comment?

(Maybe we'll have to backport http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/subscriptio...)

Can you look inside the {subscriptions_queue} table? What load_function is used? Nodes should use 'subscriptions_content_node_load', comments 'subscriptions_content_comment_load'.

I don't know the inner workings of the subscriptions_og module (and I can't really say whether that matters). It would certainly be easier for me if we could work with non-OG nodes.

#2

Status:active» postponed (maintainer needs more info)

#4

Status:postponed (maintainer needs more info)» fixed

It would be nice to get some feedback...

Reopen if we need to pursue this further...

#5

Status:fixed» closed (fixed)

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

#6

Status:closed (fixed)» active

Hi,

Sorry. Ironically, I didn't get the email that said that you had responded. I was looking into the issue last year as a favour, but now the issue has come back (rather it never left) again and I'm looking into it again and discovered that you had responded to it! So thanks!

The mail template used in both cases is subscriptions-node-group_nid in both cases. The person posts a comment and all I get is the node in the notification. Here it is for reference

{{!is_updated==1? **UPDATED** :}}{{!is_old==1?:!node_type Post by !sender_name:

}}{{!is_old==1?:!body}}{{!has_new_comments==1?!comments:}}

Files attached (if any):
!files

| Post Reply: !url

| --------------------------------------------------------------------
| This is an automated message (node-group-nid) for !recipient_name.
| Please do NOT reply to the sender address!
|
| To manage your subscriptions go to
| !manage_url
|
| Direct unsubscribe link (!subs_type):
| !unsubscribe_url

As for the {subscriptions_queue} table, you may have to help me out a little. I looked at the table under load_function and there appears to be 492 entries... 12 with subscriptions_content_comment_load and 480 with subscriptions_content_node_load. How do I know what refers to what?

Let me know if you have any thoughts on where else I should be checking. I will check this website regularly in case I don't get the message via email.

Chris

#7

Here's what it says on admin/build/mail-edit/subscriptions_content_node-nid:

Note: 'new' and 'update' notifications for Pages/Threads subscriptions use the matching content type subscriptions template rather than this one, if allowed; this does not apply to 'comment'-only notifications.

If the node is new and it already gets a comment before notifications are sent, then you'll get a notification determined by the subscription type, with the comment appended.

If a comment is added later on, then it's important to distinguish the type of the subscription that causes the notification. Is it an OG subscription or a Page/Thread subscription (such as created by auto-subscribe) or something else? Typically, comment-only notifications come in as subscriptions_content_node-nid. If you get them as subscriptions-node-group_nid, then they're apparently prepared by the Subscriptions OG module, which I don't know. Maybe you can get better help there...

Check the {subscriptions_queue} before and after adding a comment. What record(s) was/were added on your behalf? What template is subsequently used to send that notification? I wonder how to interpret 'group_nid'. Is the subscription not on the node but on the group node to which the node belongs? Do the comments go to the node or the group node? Are the comments added to the node or the group node? Are the notifications based on the node or the group node?

For debugging, change your templates to list the relevant variables in plain text, like !has_new_comments, !is_new, !comments, etc.

The possible permutations are endless. I can't really figure this out remotely, I can only try to help you to figure it out yourself...

#8

Status:active» closed (fixed)