Subcategory filter disappears on /none

The default list filter category setting, added following this topic: In a top category page, show only its own topics below subcategories - #29 by sam, causes a nondeterminist behavior as far as I understand.

It seems that setting it to “no subcategories” redirects the base category URL to the /none category URL. But sometimes this page displays the “subcategory” filter, sometimes it does not. Especially, the first time a category is clicked, this filter isn’t displayed. Hence, subcategories are nowhere to be found, completely invisible. Then, if I refresh the page, the filter reappears.

It is plausible that the filter doesn’t cause the issue but rather just reveals it, because before this filter, the only way to access /none was to open the subcategory filter so it was already displayed and we never knew that sometimes it wouldn’t be displayed. If that makes sense.

Steps to reproduce

  • In a category, set the default list filter category setting to “no subcategories” and save
  • Access said category through any regular means, e.g. link in the menu
  • Subcategory filter isn’t displayed
  • Refresh, it is now displayed
1 Like

Thanks for the detailed report, going to put pr-welcome on this in case someone from the community wants to try out a fix here.

2 Likes

You guessed it right. The filter disappeared due to a number of reasons, which in essence were failures to pass along correct category data, and track the changes properly in the UI.

For more details on the applied fix, you can check FIX: subcategory filter should be always visible on category view page by yuriyaran · Pull Request #36050 · discourse/discourse · GitHub.

1 Like