Posted by webchick on April 29, 2009 at 2:43am
| Project: | Project issue tracking |
| Version: | 6.x-1.x-dev |
| Component: | |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | 6.x-1.0 blocker |
Issue Summary
I tried to create a draft issue over at the xmlsitemap issue queue to run it past another person before I put it out for the issue queue "proper", only to discover that e-mail notifications were sent, even though the node was unpublished. :(
Comments
#1
Yes, this is a blocker. It sucks to spend much time on this stuff without fixing d.o subscriptions entirely, but we really need to fix this.
#2
Could it be that the mail got sent due to webchick's administrator role?
mail.inc has the following in place:
<?php
$grants = module_implements('node_grants');
$check_node_access = $node->status != 1 || empty($anon_auth_access) || !empty($grants);
...
while ($recipient = db_fetch_object($result)) {
...
$can_access = $check_node_access ? node_access('view', $node, $account) : TRUE;
if ($can_access) {
...
drupal_mail('project_issue', 'project_issue_update_notification', $recipient->mail, $language, $params, $from);
}
}
?>
Seems to me it is doing the right thing. What do you think?
#3
Hah, good point! ;) @yhager: can you test this on a local drupalorg_testing install to confirm that regular users don't get notification emails for unpublished nodes?
Also, what *should* the behavior be here? Should we special-case unpublished and prevent email notification for unpublished issues, even for admins that can view them?
Thanks for looking into this!
-Derek
#4
> can you test this on a local drupalorg_testing install to confirm that regular users don't get notification emails for unpublished nodes?
I tested, and this is indeed the case.
> Also, what *should* the behavior be here?
I think unpublished nodes should not generate any email notifications. The attached patch does just that.
One thing I noticed though is that when the node is being published, email is not being sent (emails are sent only on issue creation, or an addition of a comment). I am not sure how to implement this hook actually if we want to do it (but this should probably be a different issue).
#5
attached patch tweaks the patch in #4, and has been tested to work. committed to HEAD.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.