Invalid items can be added to the top_menu setting

I am mostly done here but kind of want to hand this over to @joffreyjaffeux to finish some stuff up here:

Per:

https://github.com/discourse/discourse/commit/88f5251415650f875817c3b3d4a73987a6cd270a

We have an extra allow_any attribute for site setting (default is true). If allow_any is set to false on a list, the choices are restricted so they always match the list.

So for this case, top_menu is now restricted to any combination of:

choices:
     - latest
     - new
     - unread
     - top
     - categories
     - read
     - posted
     - bookmarks

But… the control used in the UX is now an ugly text box. Since this is a site setting we can live with this, but it is visually somewhat ugly.

That said, you can no longer shoot yourself in foot, which is great.

This commit totally kills 2 features as well:

  1. You can not longer “magic” a category into top menu which we used to support, this has to be done in a theme.

  2. You can not longer use the “magic” - thingy to remove categories from lists, instead you set it in category settings.

5 Likes