# 在已归档的主题中，只有没有点赞或反应的帖子才能被“点赞”

**URL:** <https://meta.discourse.org/t/only-posts-with-no-likes-or-reactions-can-be-liked-in-an-archived-topic/399681>\
**Category:** Bug\
**Tags:** reactions, fixed\
**Created:** [2026年四月1日 06:09 UTC](https://meta.discourse.org/t/only-posts-with-no-likes-or-reactions-can-be-liked-in-an-archived-topic/399681 "2026-04-01T06:09:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)\
**Post date:** [2026年四月1日 06:09 UTC](https://meta.discourse.org/t/only-posts-with-no-likes-or-reactions-can-be-liked-in-an-archived-topic/399681/1 "2026-04-01T06:09:16Z")

</div>

我理解归档主题中的帖子无法获得点赞或反应。基于此，为何 [这篇帖子](https://meta.discourse.org/t/migrate-from-getsatisfaction-to-discourse/56197/9?u=natedhaliwal) 可以点赞（即可以按下爱心按钮，尽管会抛出“该反应创建时间过久，无法再修改或删除”的错误，而该错误本身也不准确）？

实际上，这种情况适用于该主题中的其他帖子。似乎已有点赞/反应的帖子完全无法再被点赞，而那些没有任何反应的帖子则可以点赞，尽管会抛出上述错误。

这种不一致的行为让我觉得这或许应该归类到 #Contribute > Bug 中？

---

<div class="post-metadata">

**Author:** ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)\
**Post date:** [2026年四月1日 06:15 UTC](https://meta.discourse.org/t/only-posts-with-no-likes-or-reactions-can-be-liked-in-an-archived-topic/399681/2 "2026-04-01T06:15:30Z")

</div>

我想这是因为 #reactions 插件。在安全模式下我无法执行相同操作。我记得在 Jammy 担任社区版主时，曾不小心对一篇已归档的帖子添加了表情反应。由于我的反应相当不当，他帮我移除了它。我认为之后可能添加了某些限制以防止此类情况再次发生。但我不太确定，要在我们的聊天记录中找到相关信息也会非常耗时。

---

<div class="post-metadata">

**Author:** ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)\
**Post date:** [2026年四月1日 06:18 UTC](https://meta.discourse.org/t/only-posts-with-no-likes-or-reactions-can-be-liked-in-an-archived-topic/399681/3 "2026-04-01T06:18:22Z")

</div>

好的。那么在安全模式下，该按钮完全无法点击。我猜在已归档的主题中，它应该被隐藏？

---

<div class="post-metadata">

**Author:** ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)\
**Post date:** [2026年四月1日 06:24 UTC](https://meta.discourse.org/t/only-posts-with-no-likes-or-reactions-can-be-liked-in-an-archived-topic/399681/4 "2026-04-01T06:24:52Z")

</div>

看起来我的问题出现在已经有点赞的帖子中。

> **我们的对话**
>
> Originally sent in JammyDodger
> 
> ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/moin/48/523407_2.png)
> 
> Moin
> 
> 我尝试测试归档功能与点赞和反应功能如何协同工作。
> 
> 结果是：[Button color changes - #7 by tyraniczar](https://meta.discourse.org/t/button-color-changes/91007/7?u=moin)
> 
> 我能够添加反应，但无法移除它 😂 现在它将永久保留。
> 
> ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/jammydodger/48/254611_2.png)
> 
> JammyDodger
> 
> 对于这个情况，你是在归档之前添加的反应吗？
> 
> 对我来说，归档后似乎既不能添加也不能移除反应（这是预期的行为）。
> 
> ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/moin/48/523407_2.png)
> 
> Moin
> 
> 我仍然可以在该主题中的帖子上添加 :discourse2: 反应。
> 
> ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/jammydodger/48/254611_2.png)
> 
> JammyDodger
> 
> 啊，是的。它显示你不能，但实际上你可以。
> 
> 而且无法移除。
> 
> 嗯……
> 
> 我取消了归档，并清理了多余的反应。
> 
> 我会提交一份报告。
> 
> 我在复现这个归档 + 反应的测试时遇到了一些奇怪的问题。
> 
> 在我的测试站点上，反应菜单没有显示出来。
> 
> 只显示了 🚫。
> 
> ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/moin/48/523407_2.png)
> 
> Moin
> 
> 我可以在我的沙盒环境中复现这个问题。
> 
> ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/jammydodger/48/254611_2.png)
> 
> JammyDodger
> 
> 嗯……
> 
> - 创建主题
> - 添加回复
> - 归档
> - 作为测试用户访问主题，并尝试对帖子进行反应
> 
> ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/moin/48/523407_2.png)
> 
> Moin
> 
> 现在那里也无法工作了。
> 
> ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/jammydodger/48/254611_2.png)
> 
> JammyDodger
> 
> 我在我的基础托管站点上测试了，同样无法工作。
> 
> ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/moin/48/523407_2.png)
> 
> Moin
> 
> 当测试用户创建回复后，我进行归档并立即反应（不刷新页面），添加反应是有效的。但刷新后就不行了。
> 
> 试着在归档前以 user2 的身份点赞该帖子，然后在归档后以 user3 的身份进行反应。
> 
> ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/jammydodger/48/254611_2.png)
> 
> JammyDodger
> 
> 是的，我可以用这种方法复现。

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2026年四月1日 12:42 UTC](https://meta.discourse.org/t/only-posts-with-no-likes-or-reactions-can-be-liked-in-an-archived-topic/399681/5 "2026-04-01T12:42:28Z")

</div>

感谢 @NateDhaliwal 和 @Moin，看来在处理已归档主题时，表情反应功能存在逻辑错误。

> <https://github.com/discourse/discourse/pull/39038>
>
> When a post in an archived topic has no existing likes, the backend omits the li…ke entry from \`actions\_summary\` (no count, no \`can\_act\`, no \`acted\`), making \`likeAction\` null on the frontend.
> 
> Core's like button handles this correctly (renders as disabled), but the reactions plugin — which replaces core's like button — had guards that checked \`likeAction && !(canToggle || can\_undo)\`. When \`likeAction\` was null, the guard was bypassed, allowing clicks that triggered a 403 from the backend with a misleading "too long ago" error message.
> 
> Posts with existing likes were unaffected since \`likeAction\` existed with \`canToggle: false\`, and the guard worked as intended.
> 
> This commit:
> 
> \- Flips the \`toggleFromButton\` guard from \`likeAction && ...\` to \`!likeAction || ...\` so null likeAction blocks the interaction
> \- Reorders the \`toggle()\` condition to check \`likeAction?.canToggle\` first, preventing reactions via the emoji picker
> \- Adds an early return in \`pointerOver\` when \`!likeAction?.canToggle\` to prevent the reaction picker from opening on hover
> \- Adds optional chaining in the picker's \`reactionInfo\` getter to fix a TypeError crash on \`post.likeAction.canToggle\` when null
> \- Uses the server error message in \`\_extractErrors\` when available instead of a hardcoded misleading string, and updates the fallback translation to a generic message
> 
> https://meta.discourse.org/t/399681

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2026年四月4日 12:43 UTC](https://meta.discourse.org/t/only-posts-with-no-likes-or-reactions-can-be-liked-in-an-archived-topic/399681/6 "2026-04-04T12:43:16Z")

</div>

此主题在最后一次回复后 3 天自动关闭。不再允许新回复。
