Hi, Sean! Dude, its Sunday! What are you doing here?
Sadly, recount statistics didn’t fix the problem. {comment_total} is working fine after I do the queries I mentioned before, but {total_comments} doesn’t.
I was looking at mod.comment.php and found those lines:
$row['total_comments'] = $pagination->total_rows;
if ($pagination->paginate === TRUE)
{
// When we are only showing comments and it is
// not based on an entry id or url title
// in the URL, we can make the query much
// more efficient and save some work.
$pagination->total_rows = $this->EE->db->count_all_results();
}
Looks like {total_comments} is just defined if the pagination is enabled. So, I made some tests with paginate parameter and pagination tags. If I add these lines to the comment:entries tag, {total_comments} works:
{paginate}{pagination_links}{/paginate}
The paginate or even the limit parameters aren’t needed. I believe that in case pagination === FALSE and without limit parameter, {total_comments} should be equal to {total_results}.
Should I open a bug report?
Thank you for your attention, Sean!