Users reported an issue after updating to a recent commit in the tests-passed branch, where the new topic composer fails to load due to a JavaScript error: TypeError: undefined is not an object (evaluating 'category.topic_template'). The issue stems from SiteSetting.general_category_id being set to -1, which causes the composer to break when no ‘general’ category exists. cwhatley identified the root cause and suggested setting a default value of nil for general_category_id. darkpixlz confirmed the issue, noting that the category box is blank and the composer fails when ‘uncategorized’ is disabled. Don shared a workaround using the Default Composer Category component. A fix was later merged by blake, resolving the issue, as confirmed by darkpixlz.
After installing, users are unable to bring up the new topic composer either by clicking “+ New Topic” or visiting /new-topic directly.
Javascript error on console:
TypeError: undefined is not an object (evaluating 'category.topic_template')
I suspected that the code in the PR might be at issue and went into the rails console and executed the following to set the general category is to one of our existing categories:
SiteSetting.general_category_id=5
This fixed the issue. The prior value was -1.
I believe that using a default value of nil for general_cateogory_id would fix this issue.
Same here. Users had to choose a category before they can write. Now I install the Default Composer Category component while the fix is coming so the category will not be empty when open composer.