Category filter "none" does not appear to function in some circumstances

AI-generated summary

A bug has been reported with the “none” category filter. When a user navigates to a category with the “none” filter, then changes it to “all”, and back to “none”, the filter does not work as expected, showing topics from all categories instead of just the top-level category. However, a page reload resolves the issue. nathank notes that this issue is not specific to the default category setting, but rather a general bug. vinothkannans has identified a fix for the issue with a commit to the Discourse repository.

Version ### 2.5.0.beta6 [293467a37a ]

When I load the page

https://example.com/c/slug/id/none

I get what I expect a page the includes only topics in the top level category.

if I then change “none” to “all”

I get what I expect a page with topics from all the top level category and all sub categories.

if I then change “all” back to “none”

It continue to get a page with topics from all the top level category and all sub categories.

if I then reload the page

I once again got a list of only the topics from the top level category.

2 Likes

@vinothkannans can you have a look at this issue?

4 Likes

This is a problem for us too, and I was just about to report it as a ‘bug’ as well.

I had thought that it was related to the recent addition of the Category setting that allows /none to be the default - but it actually just seems to be a bug as it happens in other categories too.

The below commit should resolve the issue.

https://github.com/discourse/discourse/commit/f67e7d2fad48012de73c45f3a91dba97652e6d7f

4 Likes