Previously selected user themes can override allowed themes
A theme issue was reported where users can still use a previously selected theme even if it’s no longer available. pfaffman noted that users who had selected a theme that was later made unavailable would still see that theme, and the theme selector would not be available if only one theme is allowed.
It was suggested that clearing the browser cache could resolve the issue, and Vaping_Community confirmed that this worked on their v2 instance. pfaffman also suggested updating user themes via the Rails console, using a command like UserOption.update_all(theme_ids: [theme_id]).
However, david noted that the theme_key is no longer used, and the correct command should use theme_ids instead. WaitroseCarpark successfully used this method to update user themes on their instance.
sam clarified that this issue only affects administrators, as end users can only see user-selectable themes. The issue is being recategorized as a support topic rather than a bug, as it’s considered minor.
On Discourse 1.9.2 (stable) if there exists a theme “A” that gets saved as a user’s default theme and then you create a theme “B” and make theme “A” not selectable by users, people who have selected theme A still get theme A.
And if theme B is the only available theme, then there is no selector on /my/preferences/interface to be able to select theme B.
Can I assume that the theme choice is saved inside the session?
I’ve been messing with my themes all day and have noticed that sometimes if I disable a theme I still have it until I clear the browser cache.
Yes. Theme B is the default and no other themes are user-selectable. You have to change the theme in the user profile to get to it (or perhaps clear the browser cache?).
Ok, I just ran a test and clearing the browser cache DOES change the theme to the default one in v2 if the one the user was previously using has been removed and a new one has been set as default.
If Make this my default theme on all devices is checked it should revert on the next refresh.
This is only the case if you are an administrator, as an end user this can not happen. I just confirmed cause we do a security check and only allow end users to see themes that are user selectable.
I am recategorizing this as support for now cause I feel it is too minor to need fixing.