FIX: New general category changes preventing topic create (#18459)

* FIX: New general category changes preventing topic create

Follow up to: #18383

The logic in the previous commit was checking for null, but we are
seeding the SiteSetting.general_category_id with an id of -1 so we need
to check for a positive value as well as checking for null.

See: https://meta.discourse.org/t/240661

* Add js test for presence of category… dropdown option
This commit is contained in:
Blake Erickson
2022-10-03 12:19:41 -06:00
committed by GitHub
parent a5fbdba9d4
commit 6affbabfd3
3 changed files with 20 additions and 2 deletions
@@ -45,7 +45,7 @@ export default ComboBoxComponent.extend({
return Category.findUncategorized();
} else {
const generalCategoryId = this.siteSettings.general_category_id;
if (!generalCategoryId) {
if (!generalCategoryId || generalCategoryId < 0) {
return this.defaultItem(null, htmlSafe(I18n.t("category.choose")));
}
}