评论列表报错
qt06 opened this issue · comments
杨永全 commented
描述这个 Bug
问题出现在独立页面的评论列表。评论没有全部显示出来,导致评论表单和页面底部代码都不显示。开启了debug模式后,打印了下面的错误信息:
<li itemscope itemtype="http://schema.org/UserComments" id="comment-4747" class="comment-body comment-child comment-level-even<pre><code><h1>Typecho\Widget::altBy(): Argument #1 ($current) must be of type int, null given, called in /data/www/www.qt06.com/var/Widget/Comments/Archive.php on line 399</h1>TypeError: Typecho\Widget::altBy(): Argument #1 ($current) must be of type int, null given, called in /data/www/www.qt06.com/var/Widget/Comments/Archive.php on line 399 and defined in /data/www/www.qt06.com/var/Typecho/Widget.php:405
Stack trace:
#0 /data/www/www.qt06.com/var/Widget/Comments/Archive.php(399): Typecho\Widget->altBy()
#1 /data/www/www.qt06.com/var/Widget/Comments/Archive.php(337): Widget\Comments\Archive->alt()
#2 /data/www/www.qt06.com/var/Widget/Comments/Archive.php(302): Widget\Comments\Archive->threadedCommentsCallback()
#3 /data/www/www.qt06.com/usr/themes/20221109default/comments.php(7): Widget\Comments\Archive->listComments()
#4 /data/www/www.qt06.com/var/Widget/Archive.php(1263): require('...')
#5 /data/www/www.qt06.com/usr/themes/20221109default/page.php(11): Widget\Archive->need()
#6 /data/www/www.qt06.com/var/Widget/Archive.php(1345): require_once('...')
#7 /data/www/www.qt06.com/var/Typecho/Router.php(88): Widget\Archive->render()
#8 /data/www/www.qt06.com/index.php(23): Typecho\Router::dispatch()
#9 {main}</code></pre>
我查询了数据库里coid维4747的记录结果如下:
| 4747 | 1 | 1355019095 | 老牛 | 0 | 1 | 376965543@qq.com | | 117.26.147.222 | Mozilla/4.0 (compa
tible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media C
enter PC 6.0; AskTbPTV5/5.12.2.16749) | 果敢`坚持`上进,只要心中有理想,未来就有希望!祝晴天老师一切顺利!
| comment | approved | 4550 |
复现方式
复现的步骤:
- 前往 '...'
- 点击 '....'
- 滚动到 '....'
- 看到错误
期望的结果
简明扼要地描述你期望看到的结果。
截图
如果可以的话,请添加截图或视频以帮助解释你的问题。
平台
- 操作系统版本:debian
- Apache/Nginx 版本:caddy
- 数据库版本:mariadb
- PHP 版本:8.1
- Typecho 版本:master最新
- 浏览器版本:chrome122
冰剑 commented
恢复默认主题测试一下是否能够复现,我觉得这是因为主题的原因造成的。
杨永全 commented
禁用了所有插件,使用classic2022和default主题都有这个错误。
joyqi commented
我这里没有复现,id 为 4550 的评论是否存在呢
杨永全 commented
评论是存在的。其他文章也有这个问题。
如果需要我可以提供数据库。
我在本地全新安装,然后导入数据,也是一样的。