Skip to content

A platform for community discussion. Free, open, simple.

FIX: Ensure `form_template_ids` is defined on new category records (#20610)

Selase Krakani0603bd57df8f
diff --git a/app/assets/javascripts/discourse/app/routes/new-category.js b/app/assets/javascripts/discourse/app/routes/new-category.js
index bceca86dac2..2fb6237719e 100644
--- a/app/assets/javascripts/discourse/app/routes/new-category.js
+++ b/app/assets/javascripts/discourse/app/routes/new-category.js
@@ -33,6 +33,7 @@ export default DiscourseRoute.extend({
custom_fields: {},
search_priority: SEARCH_PRIORITIES.normal,
required_tag_groups: [],
+ form_template_ids: [],
});
},
diff --git a/app/assets/javascripts/discourse/tests/acceptance/category-new-test.js b/app/assets/javascripts/discourse/tests/acceptance/category-new-test.js
index e940c23a015..77f4cdd89d0 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/category-new-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/category-new-test.js
@@ -22,6 +22,11 @@ acceptance("Category New", function (needs) {
await fillIn("input.category-name", "testing");
assert.strictEqual(query(".badge-category").innerText, "testing");
+ await click(".edit-category-nav .edit-category-topic-template a");
+ assert
+ .dom(".edit-category-tab-topic-template")
+ .isVisible("it can switch to topic template tab");
+
await click(".edit-category-nav .edit-category-tags a");
await click("button.add-required-tag-group");