# 如果删除了通用类别，则无法创建欢迎主题

**URL:** <https://meta.discourse.org/t/welcome-topic-cant-be-created-if-general-category-is-deleted/253773>\
**Category:** Bug\
**Created:** [2023年二月1日 23:51 UTC](https://meta.discourse.org/t/welcome-topic-cant-be-created-if-general-category-is-deleted/253773 "2023-02-01T23:51:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [2023年二月1日 23:51 UTC](https://meta.discourse.org/t/welcome-topic-cant-be-created-if-general-category-is-deleted/253773/1 "2023-02-01T23:51:23Z")

</div>

我正在构建一个新的测试实例，在创建欢迎主题（用于关闭横幅）之前，我删除了所有不需要的类别。

 ![Screenshot 2023-02-01 at 5.47.22 PM](https://global.discourse-cdn.com/meta/original/4X/3/f/d/3fdf04046c61d23188213642f368b0194f1f8da1.png)

浏览器控制台显示 403 错误和以下内容：

```plaintext
[Error] Unhandled Promise Rejection: Error: PresenceChannel '/discourse-presence/edit/10' not found
	(anonymous function) (discourse-7c613daf8a1b33d792d7fc2d9330d354e7e335d1ee1a84d3521b13962937a633.js:7482:111)
	asyncFunctionResume
	(anonymous function)
	promiseReactionJobWithoutPromise
	promiseReactionJob

```

---

<div class="post-metadata">

**Author:** ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)\
**Post date:** [2023年二月2日 04:39 UTC](https://meta.discourse.org/t/welcome-topic-cant-be-created-if-general-category-is-deleted/253773/4 "2023-02-02T04:39:08Z")

</div>

抓得好！我们很快就会在这个区域进行更改，但也许 @blake 可以找到一个简单的修复方法，至少可以防止在这种边缘情况下出错。

---

<div class="post-metadata">

**Author:** ![Iacobus1983](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iacobus1983/32/258517_2.png) [@Iacobus1983](https://meta.discourse.org/u/Iacobus1983)\
**Post date:** [2023年二月21日 14:17 UTC](https://meta.discourse.org/t/welcome-topic-cant-be-created-if-general-category-is-deleted/253773/6 "2023-02-21T14:17:21Z")

</div>

我遇到了类似的问题：在将自动生成的欢迎主题移到另一个类别后，我删除了“常规”类别。  
欢迎横幅不再显示。有什么办法可以恢复它吗？

---

<div class="post-metadata">

**Author:** ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)\
**Post date:** [2023年三月14日 16:40 UTC](https://meta.discourse.org/t/welcome-topic-cant-be-created-if-general-category-is-deleted/253773/7 "2023-03-14T16:40:37Z")

</div>

> [@tobiaseigen](#):
>
> 但也许 @blake 可以找到一个简单的修复方法，至少可以防止这种情况下的错误。

> <https://github.com/discourse/discourse/pull/20639>
>
> If you happen to delete the general category before editing the welcome
> topic, …the banner will still display. This fix adds a after destroy hook
> that will clear the entries for the welcome topic banner in the redis
> cache.
> 
> See https://meta.discourse.org/t/welcome-topic-cant-be-created-if-general-category-is-deleted/253773?u=blake

---

<div class="post-metadata">

**Author:** ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)\
**Post date:** [2023年三月14日 16:40 UTC](https://meta.discourse.org/t/welcome-topic-cant-be-created-if-general-category-is-deleted/253773/8 "2023-03-14T16:40:39Z")

</div>


