I just Reset that setting and it’s working as expected. Thanks!
I noticed that when that setting is set to no category, it doesn’t allow the user to click and type and it shows a message to pick a category, but sometimes people don’t immediately read the text. Do you by any chance know if it’s possible to show some “pop up” when the user clicks the message area, before picking a category?
EDIT: After trying many options that Claude and ChatGPT offered for this, I ended up just removing the “Disabled” property. So users can still click and write their message, but when no category is selected and they try to submit, they see the red/orange error asking to pick a category. This is actually a better behavior, in my opinion.
For others trying to do the same, here’s the Javascript I added to the <head> tab in a new component I created called Unlock Composer:
<script type="text/discourse-plugin" version="0.8">
const observer = new MutationObserver(() => {
const textarea = document.querySelector(".d-editor-input[disabled]");
if (textarea) {
textarea.removeAttribute("disabled");
textarea.setAttribute("placeholder", "Select a category before submitting");
textarea.style.cursor = "text";
}
});
observer.observe(document.body, { childList: true, subtree: true });
</script>
I’m not a developer. This was just what ChatGPT suggested and it works. If anyone sees how this can be improved, please share.
You can see there’s no default category. Now, I can type my message (unlike the default behavior, which locks the message area), even without a category being selected:
I just asked ChatGPT to see if there’s a way to simplify the script a little bit more and it removed the first line, related to the API. I updated my post with the final script, in case you want to use it.
But I believe this is not the default behavior, because even the original placeholder says something like “Select a category before typing here”, and the cursor changes to an arrow with a symbol. It doesn’t allow me to click and type, unless I pick the category.
That’s what I would expect if you have a topic template set up on one of your categories. Without any set it should allow you to enter the composer text area before setting a category. It blocks it when using topic templates so people don’t accidentally bypass that template by typing in the composer first and then selecting a category.
I’ve just had a quick test run on my site, and with no default category or topic templates I can enter the composer area without being blocked until I select a category.
Weird… I just disabled the component I created, tried it again, and now it lets me type. It’s not locked
Would it be some cache issue after I set it to (no category) or something? Cache on the server itself, because on both Chrome and Firefox, with different user accounts, I got the same behavior. I’m using Cloudflare and I noticed that sometimes there’s issues with my forum that seem to be related with Cloudflare’s cache. Again, I’m no expert, so I’m just guessing…
Out of curiosity, if you have the data explorer plugin installed, could you run this just to see what it says:
SELECT id as category_id, topic_template
from categories
I’ve just been testing this out on another site (which happens to be German as the default locale) and we spotted that there was a cheeky template added to the Uncategorised pseudo category which seems to have caused the same behaviour on that site.