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.
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
Comment #1
babusaheb.vikas CreditAttribution: babusaheb.vikas commentedHi 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.
Comment #2
paul_constantine CreditAttribution: paul_constantine commentedHello babusaheb.vikas!
That worked really well.
Thank you :-)
Comment #3
paul_constantine CreditAttribution: paul_constantine commented