Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
I've experienced the same problem.
Solved it with this code in a custom module. But why present the possibility of disabling comments in the group node content type if it is overriden by user permissions on comment module anyway? This code should not be necessary.
Can somenone explain what we are missing here?
Here follows the code to circumvent the problem.
function mymodule_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
global $user;
/*A group node should never be commented upon*/
if ( $op == 'alter' && og_is_group_type($node->type) ) {
unset($node->links['comment_add']);
}
/*A group post should never be commented upon by an anonymous user.*/
if ( $op == 'alter' && !$user-uid && og_is_group_post_type($node->type) ) {
unset($node->links['comment_add']);
}
}
Comments
Comment #1
jummonk commentedI've experienced the same problem.
Solved it with this code in a custom module. But why present the possibility of disabling comments in the group node content type if it is overriden by user permissions on comment module anyway? This code should not be necessary.
Can somenone explain what we are missing here?
Here follows the code to circumvent the problem.
Thanks.
Comment #2
Grayside commented