Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

评论列表报错 #1755

Open
qt06 opened this issue Apr 9, 2024 · 4 comments
Open

评论列表报错 #1755

qt06 opened this issue Apr 9, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@qt06
Copy link
Contributor

qt06 commented Apr 9, 2024

描述这个 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-&gt;altBy()
#1 /data/www/www.qt06.com/var/Widget/Comments/Archive.php(337): Widget\Comments\Archive-&gt;alt()
#2 /data/www/www.qt06.com/var/Widget/Comments/Archive.php(302): Widget\Comments\Archive-&gt;threadedCommentsCallback()
#3 /data/www/www.qt06.com/usr/themes/20221109default/comments.php(7): Widget\Comments\Archive-&gt;listComments()
#4 /data/www/www.qt06.com/var/Widget/Archive.php(1263): require(&#039;...&#039;)
#5 /data/www/www.qt06.com/usr/themes/20221109default/page.php(11): Widget\Archive-&gt;need()
#6 /data/www/www.qt06.com/var/Widget/Archive.php(1345): require_once(&#039;...&#039;)
#7 /data/www/www.qt06.com/var/Typecho/Router.php(88): Widget\Archive-&gt;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 |

复现方式

复现的步骤:

  1. 前往 '...'
  2. 点击 '....'
  3. 滚动到 '....'
  4. 看到错误

期望的结果

简明扼要地描述你期望看到的结果。

截图

如果可以的话,请添加截图或视频以帮助解释你的问题。

平台

  • 操作系统版本:debian
  • Apache/Nginx 版本:caddy
  • 数据库版本:mariadb
  • PHP 版本:8.1
  • Typecho 版本:master最新
  • 浏览器版本:chrome122
@qt06 qt06 added the bug Something isn't working label Apr 9, 2024
@binjoo
Copy link

binjoo commented Apr 26, 2024

恢复默认主题测试一下是否能够复现,我觉得这是因为主题的原因造成的。

@qt06
Copy link
Contributor Author

qt06 commented Apr 26, 2024

禁用了所有插件,使用classic2022和default主题都有这个错误。

@joyqi
Copy link
Member

joyqi commented Apr 26, 2024

我这里没有复现,id 为 4550 的评论是否存在呢

@qt06
Copy link
Contributor Author

qt06 commented Apr 27, 2024

评论是存在的。其他文章也有这个问题。
如果需要我可以提供数据库。
我在本地全新安装,然后导入数据,也是一样的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants