I've customized the comment wrapper (via comment-wrapper.tpl.php) to show a persistent login link for anonymous users, as well as an invitation to invite users to comment if there are no comments for the node. Since I've disabled the comment form and comment controls for anonymous users, comment_render() returns an empty string on nodes with no comments, rather than my themed comment wrapper.
I believe this is due to the conditional on line 1054 in comment.module:
if ($output) {
$output = theme('comment_wrapper', $output, $node);
}
I propose that the conditional check user_access('access comments') rather than the emptiness of the rendered comments view, so that the wrapper is not hidden in the case that the user can view comments and no comments exist.
Comments
Comment #1
sumitmadan commentedi also want this solution. if you found any please let me know?
Comment #2
cschults commentedHas anyone come up with a solution? I too need a fix for this as always want to display what my comment wrapper outputs.
Comment #3
mcrittenden commentedSwitching this to a support request--I wouldn't consider it a bug since it seems like reasonable behavior to me.
Comment #4
Ony commentedHaving the same problem as the OP.