Hi all,

I get the following error, when posting a new forum topic in the standard Drupal forum:

Notice: Undefined variable: comment_count in include() (line 33 of /var/www/www.wikinamics.org/htdocs/sites/all/themes/simplecorp/node.tpl.php).

I solved that for now by removing the comment count function from the template. But maybe there is a better solution?

Comments

babusaheb.vikas’s picture

Hi paul_constantine,

this error would occur for a node that doesn't have a comment count, as the variable won't have been set.

If you want to get rid of this notice, replace your comment function
<?php print $comment_count; ?> by
<?php if (isset($comment_count)) print $comment_count; ?>

I hope it would help you to avoid this issue.

paul_constantine’s picture

Hello babusaheb.vikas!

That worked really well.

Thank you :-)

paul_constantine’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.