# נושא חדש אינו מוגדר כברירת מחדל לקטגוריה לא מסווגת

**URL:** https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996
**Category:** Bug
**Created:** [15 באוקטובר,‏ 2022,‏ 11:29pm UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996 "2022-10-15T23:29:21Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![spdegabrielle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/spdegabrielle/32/190784_2.png) [@spdegabrielle](https://meta.discourse.org/u/spdegabrielle)
#### Post date: [15 באוקטובר,‏ 2022,‏ 11:29pm UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/1 "2022-10-15T23:29:21Z")

</div>

Hi,

When one of my users(‘leader’ role) tries to create a new topic, the category is blank, and if they click the create topic button they get a 404 error:

 ![image|690x360|error message 404](https://global.discourse-cdn.com/meta/original/4X/a/0/d/a0dbc4c8cabcdb2e69c5adb47d4bbcea2b11fb95.jpeg)

When I (staff) try to create a new topic I still have the blank category, but I get a `You supplied invalid parameters to the request: category` error

 ![image|690x198|error message](https://global.discourse-cdn.com/meta/original/4X/8/4/7/8471803560d05bcd10f6fce6781efa1ebd00b645.jpeg)

I’ve found a setting:

> Allow topics to be created without a category. WARNING: If there are any uncategorized topics, you must recategorize them before turning this off.

I done remember enabling it but it is enabled - I believe it is a default but I’m not sure.

I had a look at the uncategorised category settings:

> This category is special. It is used as the default category for new topics that do not have a category selected. If you want to prevent this behavior and force category selection, [please disable the setting here](https://xxxxx.discourse.group/admin/site_settings/category/all_results?filter=allow_uncategorized_topics). If you want to change the name or description, go to [Customize / Text Content](https://xxxxx.discourse.group/admin/customize/site_texts?q=uncategorized).

In the short term I’m worried that our users are having a bad experience and unable to post. (404 error)

I’ve tried searching [meta.discourse.org](http://meta.discourse.org) to find answers to my questions:

**Question 1: Why is the category field blank when I try to create a new topic?** (it is not blank when I post to [meta.discourse.org](http://meta.discourse.org))

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/6/0/a60f802b713a82c38648a9bd2c0f2bd999fe3a48.png)

**Question 2: If _‘Allow topics to be created without a category.’_ is enabled - why am I getting an error?** (I suspect ‘Uncategorised’ actually means ‘without a category’, but it is described as _'[…]the default category for new topics that do not have a category selected. ’_

I actually like the behaviour of [meta.discourse.org](http://meta.discourse.org); where is defaults to ‘general’ instead of uncategorised but I’m not sure which is right approach;

a) renaming ‘Uncategorised’ to ‘general’. (note: I found a post - from 2016 - that indicated this was a bad idea, and equated ‘Uncategorised’ with ‘null’ in the database.)

OR

b) Creating a ‘general’ category, moving all uncategorised to ‘general’(how?), setting ‘general’ as the default of new posts, and disabling _‘Allow topics to be created without a category.’_

Any advice - or pointers to the relevant documentation are appreciated - is appreciated.

best regards

Stephen

PS FWIW we are a OSS project and this is a free discourse instance kindly provided by the nice people at [https://www.discourse.org](https://www.discourse.org)

---

<div class="post-metadata">

### Author: ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)
#### Post date: [15 באוקטובר,‏ 2022,‏ 11:41pm UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/2 "2022-10-15T23:41:06Z")

</div>

I also noticed this. But I have disabled uncategorized but it should still select the top category in that case. It’s showing the same (empty) category field as default.

---

<div class="post-metadata">

### Author: ![spdegabrielle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/spdegabrielle/32/190784_2.png) [@spdegabrielle](https://meta.discourse.org/u/spdegabrielle)
#### Post date: [15 באוקטובר,‏ 2022,‏ 11:55pm UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/3 "2022-10-15T23:55:09Z")

</div>

Thanks @MarcP!

I think this might be a bug, but I didn’t want to pre-judge.  
s.

---

<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: [16 באוקטובר,‏ 2022,‏ 12:00am UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/4 "2022-10-16T00:00:16Z")

</div>

Hey Stephen,

Which version of Discourse is your site running?

The uncategorized “category” was recently replaced by a new general category. Has a new category of that name appeared on your site? Did you have a general category previously?

---

<div class="post-metadata">

### Author: ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)
#### Post date: [16 באוקטובר,‏ 2022,‏ 12:08am UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/5 "2022-10-16T00:08:02Z")

</div>

> [@Stephen](#):
>
> Did you have a general category previously?

Yes I had a general category before. Running the most recent build but noticed it since, a few weeks?

---

<div class="post-metadata">

### Author: ![spdegabrielle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/spdegabrielle/32/190784_2.png) [@spdegabrielle](https://meta.discourse.org/u/spdegabrielle)
#### Post date: [16 באוקטובר,‏ 2022,‏ 12:16am UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/6 "2022-10-16T00:16:54Z")

</div>

Yes this seems to be recent behaviour for me too.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [16 באוקטובר,‏ 2022,‏ 3:18am UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/8 "2022-10-16T03:18:56Z")

</div>

This should have been fixed by this commit, but I can see that your site has alrady been updated to include it:

[https://github.com/discourse/discourse/pull/18548](https://github.com/discourse/discourse/pull/18548)

There’s a chance it hasn’t covered every case. We’ll get someone to look into it. 👍

---

<div class="post-metadata">

### Author: ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)
#### Post date: [16 באוקטובר,‏ 2022,‏ 5:13am UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/10 "2022-10-16T05:13:01Z")

</div>

> [@Stephen](#):
>
> The uncategorized “category” was recently replaced by a new general category. Has a new category of that name appeared on your site? Did you have a general category previously?

Hmm, when I enable `allow uncategorized topics` the uncategorized category still appears on my category page. Even after I renamed my general.

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [16 באוקטובר,‏ 2022,‏ 8:12am UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/11 "2022-10-16T08:12:15Z")

</div>

The `Uncategorized` category is not a default site setting now since when `General` category is enabled on Discourse. On the new Discourse installs there is a default `General` category. So when you open the composer the automatically selected category is `General`. However on older installs where you haven’t general category, I think any category can be the general category. I think it is just means in this case the composer default category. So that won’t be enough if you create a category with `General` name. You have to set up the category id with the hidden site setting `general_category_id` too.

For example:  
If you create a new category for this General purpose. The category name can be for example: **General** and you should check the category id as well. Now in this example it will be `9`.

The category created successfully but if you open the composer it won’t be the default category so let’s set up the hidden site setting.

> **Set up category\_id to general category**
>
> Note: category\_id=9 is just in this example the correct category id. Your newly created category probably have a different category\_id number.
> 
> `cd /var/discourse`  
> `./launcher enter app`  
> `rails c`  
> `SiteSetting.general_category_id=9`  
> `exit`  
> `exit`

After this, when you open the composer the `category_id=9`… **General** category will be the default.

---

<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: [16 באוקטובר,‏ 2022,‏ 9:51am UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/12 "2022-10-16T09:51:36Z")

</div>

Have you rebuilt since renaming general?

---

<div class="post-metadata">

### Author: ![spdegabrielle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/spdegabrielle/32/190784_2.png) [@spdegabrielle](https://meta.discourse.org/u/spdegabrielle)
#### Post date: [16 באוקטובר,‏ 2022,‏ 10:15am UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/13 "2022-10-16T10:15:28Z")

</div>

> [@Stephen](#):
>
> Have you rebuilt since renaming general?

We have not renamed general - we only have ‘uncategorized’ and we have not renamed it.

> Discourse updated: 14 hours ago

we are a OSS project and this is a free discourse instance (kindly provided by the nice people at [https://www.discourse.org](https://www.discourse.org)) so upgrades happen automatically without our intervention

Category still comes up blank

 ![image](https://global.discourse-cdn.com/meta/original/4X/c/9/9/c996557ebf573f4548001996f1328e03564b6fc5.jpeg)

---

<div class="post-metadata">

### Author: ![spdegabrielle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/spdegabrielle/32/190784_2.png) [@spdegabrielle](https://meta.discourse.org/u/spdegabrielle)
#### Post date: [16 באוקטובר,‏ 2022,‏ 10:22am UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/14 "2022-10-16T10:22:30Z")

</div>

@Don

> [@Don](#):
>
> You have to set up the category id with the hidden site setting `general_category_id` too.

Thanks - this is a hosted instance so I’m not aware of a way to get shell access to set the hidden site setting.

Best

Stephen

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [16 באוקטובר,‏ 2022,‏ 10:34am UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/15 "2022-10-16T10:34:53Z")

</div>

It’s the weekend for most of the Team, but we can fix that up for you as soon as someone is available. 🙂👍

---

<div class="post-metadata">

### Author: ![spdegabrielle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/spdegabrielle/32/190784_2.png) [@spdegabrielle](https://meta.discourse.org/u/spdegabrielle)
#### Post date: [16 באוקטובר,‏ 2022,‏ 11:03am UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/16 "2022-10-16T11:03:51Z")

</div>

I just want to make sure - so I can minimise disruption to end-users:

1. do I need to create a ‘General’ category in preparation ?

2. Will I need to move all topics with the category ‘Uncategorised’ to general after the config change is made?

Thanks for your help

Stephen

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [16 באוקטובר,‏ 2022,‏ 11:55am UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/17 "2022-10-16T11:55:30Z")

</div>

> [@spdegabrielle](#):
>
> I actually like the behaviour of [meta.discourse.org](http://meta.discourse.org); where is defaults to ‘general’ instead of uncategorised

If you’re aiming for this outcome rather than `#uncategorized` as your deafult you should be safe creating a new `#general` category, moving all of your `#uncategorized` topics into it using the bulk tool, and then disabling `allow uncategorized topics` in your admin settings in preparation (though this won’t fix the dropdown).

However, this will only take a Team member a couple of minutes to fix up along with manually updating your hidden `general_category_id` setting so you may just want to wait. 🙂

---

<div class="post-metadata">

### Author: ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)
#### Post date: [16 באוקטובר,‏ 2022,‏ 6:20pm UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/19 "2022-10-16T18:20:23Z")

</div>

Thanks, this explanation is very good and I got it sorted. I think this topic should be in #Support as it’s not a bug and I suggest your reply should be marked as solution.

---

<div class="post-metadata">

### Author: ![spdegabrielle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/spdegabrielle/32/190784_2.png) [@spdegabrielle](https://meta.discourse.org/u/spdegabrielle)
#### Post date: [16 באוקטובר,‏ 2022,‏ 9:58pm UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/20 "2022-10-16T21:58:35Z")

</div>

Just so I understand

- New instances of discourse have a General category that is the default when posting a new topic.

- our instance comes from a time when the default was the ‘uncategorised’ category.

The fix is to set the `SiteSetting.general_category_id` to the Uncategorised category ID

This command:

> `SiteSetting.general_category_id=<new category id>`

- Instances that still have the Uncategorised category should set the above setting when upgrading

---

<div class="post-metadata">

### Author: ![spdegabrielle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/spdegabrielle/32/190784_2.png) [@spdegabrielle](https://meta.discourse.org/u/spdegabrielle)
#### Post date: [18 באוקטובר,‏ 2022,‏ 8:28am UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/30 "2022-10-18T08:28:26Z")

</div>

All sorted. We moved to using ‘General’ instead of uncategorised and the system correctly provides a default category.

Thank you to everyone who helped diagnose this issue, and special thanks to @fzngagan for sorting it out so quickly and professionally.

best regards

Stephen

---

<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: [18 באוקטובר,‏ 2022,‏ 7:06pm UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/31 "2022-10-18T19:06:44Z")

</div>

For anyone that happened to manually deleted the seeded General category before this fix

[https://github.com/discourse/discourse/commit/efb116d2bd4d1e02df9ddf79316112e0555b4c1e](https://github.com/discourse/discourse/commit/efb116d2bd4d1e02df9ddf79316112e0555b4c1e)

There is now an additional fix that will clean up the `SiteSetting.general_category_id` if it is set to a category that doesn’t exist:

[https://github.com/discourse/discourse/pull/18634](https://github.com/discourse/discourse/pull/18634)

---

<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: [18 באוקטובר,‏ 2022,‏ 7:07pm UTC](https://meta.discourse.org/t/new-topic-not-defaulting-to-uncategorised/241996/32 "2022-10-18T19:07:32Z")

</div>


