# 更改“允许所有者无限期编辑首帖”时出现分类别名错误

**URL:** https://meta.discourse.org/t/category-slug-error-when-changing-allow-owner-to-edit-first-post-indefinitely/407105
**Category:** Bug
**Tags:** categories
**Created:** [2026年七月8日 19:32 UTC](https://meta.discourse.org/t/category-slug-error-when-changing-allow-owner-to-edit-first-post-indefinitely/407105 "2026-07-08T19:32:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![copymonopoly](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@copymonopoly](https://meta.discourse.org/u/copymonopoly)
#### Post date: [2026年七月8日 19:32 UTC](https://meta.discourse.org/t/category-slug-error-when-changing-allow-owner-to-edit-first-post-indefinitely/407105/1 "2026-07-08T19:32:49Z")

</div>

当我尝试将类别设置 **“允许所有者无限期编辑首帖”** 从 false 改为 true 时，原本可选且为空的 **“类别别名”** 字段突然触发了一个错误，提示：_“要继续操作，请更正以下内容：类别别名：必填。”_

---

<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年七月8日 19:41 UTC](https://meta.discourse.org/t/category-slug-error-when-changing-allow-owner-to-edit-first-post-indefinitely/407105/2 "2026-07-08T19:41:34Z")

</div>

我可以复现该问题。看起来 `slug` 仅在创建时是可选的，而在编辑时不是。

 ![Screenshot_20260708_214602_Firefox](https://global.discourse-cdn.com/meta/original/4X/d/8/a/d8aa7d9054c6e9599efa23b00113824c3f241a16.jpeg)

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2026年七月8日 22:56 UTC](https://meta.discourse.org/t/category-slug-error-when-changing-allow-owner-to-edit-first-post-indefinitely/407105/3 "2026-07-08T22:56:29Z")

</div>

发现得好！感谢报告，如果保存编辑时留空，我们会自动生成一个 slug，所以这里的验证过于严格了。

我正在移除这里的验证：

> <https://github.com/discourse/discourse/pull/41570>
>
> Reported here: https://meta.discourse.org/t/category-slug-error-when-changing-al…low-owner-to-edit-first-post-indefinitely/407105
> 
> We throw a validation error on category edit if you leave the slug field blank, but it's not actually required at all... we'll auto-generate one if it's blank. Also updated the placeholder text to clarify (we auto replaces spaces with dashes too, so that's unnecessary guidance)
