Non-staff users are able to access uncategorized even when disabled

AI-generated summary

The discussion revolves around a bug where non-staff users can access the #uncategorized category even when it’s disabled via site settings. jomaxro reports that users can navigate to /c/uncategorized directly or via the category filter dropdown, where they can create new topics without selecting a category—contrary to expected behavior. j.jaffeux acknowledges the issue and proposes a fix via a pull request (#7922), focusing on preventing topic creation without a category selection. codinghorror and sat confirm the issue, with sat noting that while the category is not visible in search, it still appears when accessed via direct link. Stephen and schleifer argue that the behavior isn’t a bug since uncategorized is not private, but jomaxro insists the ability to create uncategorized topics without a category selection is a regression. The thread concludes with codinghorror suggesting the issue be closed if the fix is satisfactory.

While researching https://meta.discourse.org/t/cant-prevent-creation-of-uncategorized-topics/104874/7, I found that users can view Uncategorized even if it is disabled via site setting and has no topics within it. Users can visit it by navigating directly /c/uncategorized, as well as by searching in the category filter dropdown:

The New Topic button is on the (empty) page, and lets them start composing without selecting a category, which shouldn’t be possible with the setting off. The composer should look like this:

5 Likes

Maybe we regressed here @j.jaffeux? Not sure.

1 Like

I don’t think we regressed here.

1 Like

Fine with me.

What about this? It seems like a regression to me - with Uncategorized disabled users should be required to select a category before composing the body. However they are able to compose the body without a category if they click new topic from the uncategorized page.

Yes I fixed what was very easy for me. Need to think about the composer, if you thought we absolutely had to remove the URL, then it was solved with it. Maybe I should just redirect. Need to dig more, uncategorized has many cases and I’m unsure what this would cause.

3 Likes

What did we want to do with this @j.jaffeux?

2 Likes

I can confirm this bug is still there. You will not see uncategorized category in search but if you access thru link it shows.

https://yourdiscoursesite.com/c/uncategorized

1 Like

@codinghorror anyone looking into this?

That’s.. not a bug though. The OP stuff, @j.jaffeux I am sure is looking at.

4 Likes

I feel it is a bug.
If I access “staff” or “lounge” category it shows “Oops! That page doesn’t exist or is private.”

but for “uncategorized” it shows “There are no more Uncategorized topics.” I deleted all topics otherwise it shows those topics.

Sure because those are private categories.

It’s not a bug, nor is it the subject of this topic.

1 Like

For the purposes of the Contribute > Bug category, there is a specific definition:

That is unexpected behaviour, but it is not a bug.

3 Likes

It think that should be a decent fix:
https://github.com/discourse/discourse/pull/7922

Didnt write a test because it seems we currently have nothing “uncategorized” related in the js test suite.

3 Likes

Close this @jomaxro if you feel it is good now.

1 Like