Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
It can be helpful for a site admin to be notified of any comments made on the site, even if they aren't the author of the node nor hasn't commented on the node.
Proposed resolution
Add a permission to be notified of all comments posted to the site.
Remaining tasks
- ❌ Decide whether this feature is appropriate to include in the Comment Notify project
- ❌ If yes, write a patch implementing the proposed resolution
- ❌ If no, update the Comment Notify project description to mention the SCN module as an approach
Comment | File | Size | Author |
---|---|---|---|
#13 | interdiff_12-13.txt | 565 bytes | kbrodej |
#13 | 2926228-13.patch | 22.03 KB | kbrodej |
| |||
#12 | interdiff_11-12.txt | 18.4 KB | kbrodej |
#12 | 2926228-12.patch | 22.1 KB | kbrodej |
#11 | 7-11-interdiff.txt | 5.43 KB | jurgenhaas |
Comments
Comment #2
jimmy_sebastian CreditAttribution: jimmy_sebastian at Zyxware Technologies commentedComment #3
workplaysleep CreditAttribution: workplaysleep commented+1 for this feature, since rules is still in beta (and might be overkill for just this feature)
Comment #4
david.qdoscc CreditAttribution: david.qdoscc commentedEven better than simply notifying the site admin would be to notify all users with selected role(s) for comment notifications, with the additional option of selecting whether to notify just new unapproved comments or all comments.
Comment #5
nkoporecCreated a patch, which adds a new permission All comments.It sends the notification to all users with this permission.Added a new config message template so you can modify it.
Comment #7
nkoporecAdded config schema.
Comment #9
jimmy_sebastian CreditAttribution: jimmy_sebastian commentedComment #10
david.qdoscc CreditAttribution: david.qdoscc commentedThank you for this patch. It works as described. It is still just for when the comments are published isn't it? Any chance of getting it to also notify of unpublished comments, so the editor can go in and approve them?
Comment #11
jurgenhaasRe-rolled patch from #7 and also fixed coding standard issues in the patch code.
Comment #12
kbrodej CreditAttribution: kbrodej at Agiledrop - Your Trusted Drupal Teammates commentedHi. I reviewed the patch from #11. There was an issue with tests which should be ok now.
Also I added the requested feature in #10
Comment #13
kbrodej CreditAttribution: kbrodej at Agiledrop - Your Trusted Drupal Teammates commentedRevisited the issue, found the reason why test were failing was in wrong method call in test itself. Created a patch which should fix the issue.
Comment #14
attisanfound multiple problems with this patch.
$users = User::loadMultiple();
should be avoided at all costs. this does not scale at all and renders sites with thousands of users broken as no amount of php memory limit would suffice loading all users objects. what is worse: in most cases it will work, but slow down commenting severely with little to no effect (depending if anyone has the permission or not)._comment_user_accounts_to_notify_send($comment, [$comment->getAuthorEmail()]);
when deleting a comment does not work as the signature requires a third argument to be passed along.Comment #15
gregglesThere is another module at https://www.drupal.org/project/scn which provides this feature.
In my opinion it would be appropriate to turn this issue into "document the SCN module on the project page" and focus folks who want that feature to that module.
Comment #16
ivnish CreditAttribution: ivnish commentedThanks, @greggles!
It's my module. Also my module can sent notifications to telegram
Comment #17
cedeweyI've updated the issue title and description to reflect this feature request and that this needs a decision on whether this feature is appropriate for this module.
My two cents is that it is not. The stated purpose of this module is, "Comment Notify is a lightweight tool to send notification e-mails to visitors about new, published comments on pages where they have commented."
The scope of this module has already expanded to also include authors being notified of comments on their content.
There is already an alternative module, Simple Comment Notify which provides this functionality.
Comment #18
gregglesI think that's enough discussion and agreement - this is a useful feature for other modules.
Thanks for your thoughts, cedewey.