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.
The 5.x version of comment_notify is better integrated, but still requires a patch in comment.module to trigger on published comments
This is a one-line change where the block
// Explain the approval queue if necessary, and then
// redirect the user to the node he's commenting on.
if ($status == COMMENT_NOT_PUBLISHED) {
drupal_set_message(t('Your comment has been queued for moderation by site administrators and will be published after approval.'));
}
is just enhanced by this else
// Explain the approval queue if necessary, and then
// redirect the user to the node he's commenting on.
if ($status == COMMENT_NOT_PUBLISHED) {
drupal_set_message(t('Your comment has been queued for moderation by site administrators and will be published after approval.'));
}
else
{
comment_invoke_comment($edit, 'publish');
}
which then triggers comment_notify
as patching comment.module for all different version is a big pain for many users,
this should be implemented in comment.module ASAP to help even drupal users use my comment_notify module
as well as alllow other plugins to trigger some work when comments are published
Thanks
christoph
Comment | File | Size | Author |
---|---|---|---|
#2 | comment_publish_status.patch | 748 bytes | greggles |
Comments
Comment #1
gregglesBeing an api change I doubt this will make it in, but at least here is the change in patch form.
If this is removed from the 6.x-dev queue, I would request at least that the updater state whether this makes sense for 7.x OR if another solution is possible.
Comment #2
greggleswith patch this time...
Comment #3
gregglesI should probably think about this more, but I'm not sure any more if this really is an API change.
According to http://api.drupal.org/api/5/function/hook_comment there already is a "publish" op. This is just a matter of calling it in a new place and redefining it as "comment is published either by admin or directly by the user".
right?
Comment #4
funana CreditAttribution: funana commented+1
Comment #5
Christoph C. Cemper CreditAttribution: Christoph C. Cemper commentedas we already have this hook defined this is not a NEW hook.
it's a fix to comment.module that the already defined hook is called as required to notify other modules
+1
Comment #6
Christoph C. Cemper CreditAttribution: Christoph C. Cemper commentedComment #7
Lloyd Standish CreditAttribution: Lloyd Standish commentedMy vote in favor:
+1
Comment #8
moshe weitzman CreditAttribution: moshe weitzman commentedyup, is a small bug fix. thx.
Comment #9
Gábor HojtsyFine, committed! Please update the hook_comment docs to actually tell what is happening. (I checked that mass operations properly invoke this publish op).
Setting to needs work to await the documentation update.
Comment #10
Christoph C. Cemper CreditAttribution: Christoph C. Cemper commentedwow - great - which drupal core version will we get this?
Comment #11
jmlane CreditAttribution: jmlane commentedI am interested in updating the documentation to comment_save() as part of comment.module, however I am not sure how to submit changes.
Comment #12
Junyor CreditAttribution: Junyor commented@Christoph: It's in Drupal 6.
Comment #13
Gábor Hojtsyjmlane: http://drupal.org/patch (although I did reopen the issue to get people submit changes to the hook_comment()) docs which are not hosted as part of Drupal core, but in the contributions CVS repository.
Comment #14
dpearcefl CreditAttribution: dpearcefl commentedDo we still need to leave this issue open?
Comment #15
greggles@dpearceMN it is open for docs which can be updated by anyone.
Comment #16
dpearcefl CreditAttribution: dpearcefl commentedSorry, but I don't quite understand what you are saying. This issue hasn't been touched in 3.5 years. Is any work being done on this? if no one wants to update the documentation, then perhaps this issue is not important?