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

sumitmadan’s picture

i also want this solution. if you found any please let me know?

cschults’s picture

Has anyone come up with a solution? I too need a fix for this as always want to display what my comment wrapper outputs.

mcrittenden’s picture

Category: bug » support

Switching this to a support request--I wouldn't consider it a bug since it seems like reasonable behavior to me.

Ony’s picture

Having the same problem as the OP.

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.