This is a pretty severe bug that I encountered after an upgraded a site from Drupal 5 to Drupal 6. Users were getting new content notifications whenever a comment was made with and without comment notification (That e-mail was sent as well). I finally found the problem:

Whenever we have a user with new comment notification and a new comment, notify is adding the node that was commented on to the $nodes array. This means that on the next pass count($nodes) > 0 and so the next user will get a new content notification. The issue is resolved by instantiating a new variable instead of using the $nodes array.

I will try to get you a patch to DRUPAL-6--1 CVS branch if you need it.

CommentFileSizeAuthor
#1 notify.patch2 KBmradcliffe
notify.patch1.79 KBmradcliffe

Comments

mradcliffe’s picture

StatusFileSize
new2 KB

Okay, patch to CVS DRUPAL-6--1 here. The other patch worked fine, but it's more of a community-friendly sentiment to generate the cvs patch, right? ;-)

mradcliffe’s picture

Status: Active » Needs review

Forgot to change the status.

matt2000’s picture

Status: Needs review » Fixed

FTR, Either patch format is fine by me.

Thanks for the fix. Committed.

Status: Fixed » Closed (fixed)

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

izmeez’s picture

Status: Closed (fixed) » Needs review

Is this working for others?

It was committed on 2010-10-08 and is in the dev release but not in the 6.x-1.2 release.

When I tested this as part of an update awhile ago it caused a cron error when new comments existed. Sorry, it was a while ago and I don't have any more details.

We are using the 6.x-1.2 release without problems and it does not have this patch.

Is anyone else having problems with this commit?

I have changed the status to "Needs review", hope that is ok.

izmeez’s picture

PS there is a bug in d.o. issue summary process; my id is now showing as the author of the issue summary which is not the case.

mradcliffe’s picture

Yes, this has been working appropriately for us now, and our users are not getting e-mail notifications for nodes they are not subscribed to.

Edit: the new issue look is to show the last revision author in the node's meta data.

parasolx’s picture

izmeez, please try apply fixed in this issues regarding your problem. i'm totally sure that it cause a cron to be stop because of this: #947264: Nodes with new comments are announced as "new posts"

parasolx’s picture

at line 547,

$node = $node[$nid];

it supposed to be:

$node = $nodes[$nid];

the string should be $nodes not $node which cause the error shown. $node is reserve for drupal variable. while in this module, $nodes refer to the array. it fixed at my site.

izmeez’s picture

@mradcliffe So if I understand the problem as described in comments #1 and #7 users were getting email notifications for nodes they are not subscribed to.

We have not encountered this however, we are using some added patches for default settings and user permissions. I am wondering if others can confirm this bug, the traffic on this issue seems amazingly low considering the number of sites that appear to have this module. (3387 sites report 6.x of which only 105 report 6.x-1.x-dev)

Meanwhile, I can confirm that the refinement in comment #9 solves the cron problem. But, still don't know if this patch is required.

mradcliffe’s picture

We were getting complaints about receiving bogus notifications, and I found this to be the root cause.

I haven't looked at this issue in a while because we patched the issue out, but I think writing some tests might help. That and to re-roll for git.

Edit: I am going to be away for this week, but I can setup my local environment to maybe get some work done in the car / conference.

mradcliffe’s picture

Status: Needs review » Fixed

I can't write any valid tests for notify because you can't run multiple cron runs in such a short period of time. I know this was an issue, but I cannot find any of my notes from when I tested this over a year ago.

I'm moving this back to fixed. I did find a small typo in the patch, but that is unrelated to this issue.

izmeez’s picture

@mradcliffe, Thanks for taking the time to review this. Was the small typo you found the one identified in comment #9 ?

ishmael-sanchez’s picture

Assigned: Unassigned » ishmael-sanchez
mradcliffe’s picture

@izmeez, yes, that's the one.

Status: Fixed » Closed (fixed)

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

ishmael-sanchez’s picture

Status: Closed (fixed) » Needs work
matt2000’s picture

Assigned: ishmael-sanchez » Unassigned
gisle’s picture

Status: Needs work » Fixed

I've no idea why this was re-opened in #17, and no reason was given.
I've verified that the original issue, as well as the typo identified in #9, has been fixed.

I think this should be closed. If someone still think it needs work, feel free to reopen but then also state the reason for reopening.

Status: Fixed » Closed (fixed)

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

izmeez’s picture

@gisle, where did you confirm the typo in comment 9 was committed?

gisle’s picture

Status: Needs review » Patch (to be ported)

@izmeez, my bad.

It is fixed in the 7.x-1.x branch (line #997 in notify.module in the 7.x-1.x-dev version).

But you're absolutely right. As of now, it remains unfixed in 6.x-1.x-dev.

I don't know how I got the two versions mixed up, but somehow I did.

As for maintenance of the Notify project: I am only working actively on the Drupal 7 port. I am not happy about the the issue queue for the 6.x-1.x branch, but since I am not the project owner, and only signed on as co-maintainer because I desperately wanted a stable Drupal 7 port, I'll leave it to the project owner matt2000 and the community to sort out the issue queue for the 6.x-1.x branch. (Also see the section Support Status on the project page.

Since this is fixed in the 7.x-1.x branch, I'm setting the status to "patch (to be ported)" (but "fixed" was clearly wrong).

Edit: Since the bug mentioned in comment #9 was introduced in patch that was applied after the release of 6.x-1.2, it does not apply to that particular version, only to the development snapshots released after 6.x-1.2. It has been fixed in the 6.x-1.x-dev development snapshot commited today. Se also: #947264: Nodes with new comments are announced as "new posts"

izmeez’s picture

Status: Closed (fixed) » Patch (to be ported)
Issue tags: +needs backport to 6.x

@gisle, thanks for the update. I'll have to checkout your work on the 7.x branch when I get a chance.

gisle’s picture

Status: Patch (to be ported) » Needs review

I've finally managed to get my head around this:

A simple typo was present in the patch in comment #1 above and made it into commit 5ec7f53 in 6.x-1.x-dev (committed on Oct. 8 2010).

The typo pas pointed out by parasolx on Sep. 5 2011 in comment #9, but the correction was for some reason only applied to the 7.x-1.x branch (the buggy patch had been applied to both branches).

This typo has now also been corrected in the 6.x-1-x branch (commit 5f9be1a). There is a link to the Developement release on the Notify project page.

Please review and report back to this thread.

izmeez’s picture

@gisle ok, so just to be clear,

the patch in #1 with the typo corrected is the fix and has been committed, right?

and you are asking users to report their experience on testing the 6.x-1.x-dev release, right?

or can this patch be marked as RTBC?

Thanks.

gisle’s picture

The the patch in #1 with the typo corrected is the fix and it has now been committed to 6.x-1.x-dev in a corrected version.

I am asking users running Notify on a Drupal 6 production site to report their experience on testing the 6.x-1.x-dev release. (It is OK to test on a staging server - I understand that people don't want to use a production server for test purposes.)

Only after it (I hope) passes community testing, it will be marked as RTBC. I usually change status about two weeks after the first favourable review from someone who is not the author of the patch. The delay is to encourage multiple reviews. But after some time, a single favourable review is enough to progress a proposed patch to RTBC.

Btw. if you (or anyone else) are aware of other patches in the issue queue that should be included in the dev version to improve its stability, please point them out so that they may be considered for inclusion in the next snapshot.

Likewise, if your site uses custom patches that you think improves stability compared to 6.x-1.2, please post them here for consideration.

If all this goes well, I will probably release Notify 6.x-1.3 in the not too distant future. I.e. after all applicable patches has been committed to dev and tested. This is the moment when RTBC is changed into Fixed.

Since I am not running any Drupal 6 production sites that uses Notify, I prefer to not review patches for the 6.x-1.x-dev myself (I do of course test them on a test server before committing). This is why progress on improving the 6.x-1.x branch depends so much on community effort.

mradcliffe’s picture

Status: Patch (to be ported) » Needs review

I probably won't have time to follow-up on this for a while, but again, the typo'd original patch comes from me from 3 years ago (yikes!).

Status: Closed (fixed) » Needs review
gisle’s picture

Issue summary: View changes
Status: Needs review » Fixed

Thus is fixed per comment #27 above.

Status: Fixed » Closed (fixed)

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