Can't figure out why, but I'm getting multiple notifications per post (thread subscriptions). Always at least two, sometimes three. Also I'm set to immediate sending, but I get a digest also.
When I look at my subscriptions: just one to each of the threads involved.
I'm only using one messaging type: plain ol' email.
(I've also found that my canceled subscription doesn't cancel. I think these may be related)
Ideas on where to look to hunt this down?
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | notifications_content-prevent-duplicate-comment-event-on-edit-498220-8.patch | 1.41 KB | foxtrotcharlie |
| #4 | fixedits.patch | 910 bytes | mthomas |
Comments
Comment #1
aharown07 commentedLooks now like most of these multiple notifications are due to comment editing. I'm changing to feature request, because I think a good solution for our site, and probably many others, would be a "don't send notificaitons for edited comments" default/global setting.
Note: this is probably only useful when using instant notifications.
Comment #2
mthomas commentedThis would also be useful to me: subscribers' mailboxes are flooded when someone decides to edit their comment multiple times. I'll work on a patch!
Comment #3
mthomas commentedLooking at the 6.x-2.0 version of Notifications, on line 714 of notifications_content/notifications_content.module states that, "For 'publish' operations we notify if the comment was not published before." However, this seems to be incorrect, as my site is sending notifications for comments that were edited after already being published.
Anyone have any thoughts on this issue? I think my next step is to test comment creation and see if the notifications_comment_status variable is being set properly.
Comment #4
mthomas commentedIn notifications_content/notifications_content.module:
The problem is that $form['admin']['status'] isn't being rendered on my site for non-admin users, so the notifications_comment_status variable is never set. Because it's never set, Notifications looks at every edit and thinks that it's a new comment. We don't want users to be able to see the publication option. Altering the function in the following manner fixed the problem on my site:
I'm changing this back to a bug report. Patch is attached. I think this change could be applied to 6.x-4.0 versions, as well.
Comment #5
aharown07 commentedExcellent. This seems to explain some problems I've been seeing.
Haven't had a chance to test yet but hope this works out.
Comment #6
aharown07 commentedTested patch. It's working correctly on my site so far and not creating any problems. Didn't have time to set up notif. on my test site, so I'm actually using it on a live site. No troubles to report.
Edit: I am using Notif 6x-2.2 and patched manually (it was easier since we're talking about three lines of code).
Comment #7
mthomas commentedGlad this patch was useful. It's sort of a specific situation, but an annoying one for users!
Comment #8
foxtrotcharlie commentedIf notifications are enabled for comments, when a user who does not have "Administer comments" permission edits a comment (which has already created a notification event), another notification event is created. This causes users to receive duplicate notifications for the same comment. If the original comment notification has not yet been sent to the user (i.e. it is queued), then both the original and the edit notification will contain exactly the same content. By design, the notifications module appears to agree that once a comment has been published, it shouldn't create another notification event if edited and saved.
But, it uses a value in the "Admin" fieldset to determine the published status of the comment (in the notifications_content_module), and this fieldset on comments is only displayed to users with the "Administer comments" permission. So, a user that does not have this permission will never see this form and $form['admin']['status'] does not appear in the $form array.
To fix this issue in the notifications module:
@mthomas - I've changed your solution slightly - I wasn't sure of the need to check the node status, so removed it. I also implicitly specify the value of 'notifications_comment_status' to be 0, instead of your empty value. This is how the default is set in comment.module (line 1271):
Not having the "Administer comments" permission means that the user will never be able to edit an unpublished node, so if they are editing it, I think it's safe to assume that it is already published, and set the default status to published, which is strangely 0 for comments (as opposed to 1).
So my solution is:
This doesn't cater for the scenario of an admin user who unpublishes a comment, and then republishes - then the duplicate notification will be sent. But I think that's fine - probably won't happen very often, and hopefully they will have permission to check the 'don't send notifications for this post'...
Here's my patch for notifications 6.x-2.3. If this approach is acceptable, I'll create a patch for the 6.x-4.x-dev and 6.x-2.x-dev versions. I changed priority to Major because I think that duplicate notifications are a serious problem.
Comment #9
ron collins commentedjust carefully tested #8 with success on 6.x-2.3
thanks!
changing the status. not sure how many need to test before that happens.
Comment #10
jose reyero commentedCommitted (with some changes).
Thanks.