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.
When trying to load a node page with AuthCache enabled, the theme was completely broken and this error was at the bottom of my source code:
<script type="text/javascript">
Authcache.info = {"Reason":"PHP Error","type":1,"message":"Call to undefined function comment_num_replies()","file":"C:\\web\\htdocs\\sites\\all\\modules\\authcache\\authcache.module","line":564};
</script>
Looking at line 564, it's calling a function (comment_num_replies) which isn't used in Drupal 7, so I removed it and it seems to be working fine now. That's probably not the best way to resolve this, but it was the quickest solution.
Old:
if ($variables['user']->uid && comment_num_replies($variables['comment']->cid) == 0) {
New:
if ($variables['user']->uid) {
Comments
Comment #1
Punchy CreditAttribution: Punchy commentedWhen I tried AuthCache I had similar error, I follow your solution and it's work,
Thank you lrobeson !
Comment #2
simg CreditAttribution: simg commentedI've commented this line out in the dev version too whilst I work out what to do about this.
Thanks :)