Users can have disabled themes
matt westgate - January 2, 2004 - 06:41
| Project: | Drupal |
| Component: | system.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | matt westgate |
| Status: | closed |
Description
If an administrator disables a theme that other users have marked default in their preferences, Drupal still tries to unsuccessfully render the disabled theme for the user.
This patch will set the obsolete user themes back to the default theme so they will always be able to view the site.
| Attachment | Size |
|---|---|
| system.module.patch | 967 bytes |

#1
Changing to patch status.
#2
I'd like to discuss the approach taken in this patch. If an administrator disables the theme and reactivates it later, the users' theme settings will be lost. If you look at the code in
init_theme()you'll notice that the function does not check anything. To avoid such setting loss, we could easily modifyinit_theme()not to load themes that are not in the$themesarray.(Speaking of which, I'm not sure why we are constructing and using a
$themeobject ininit_theme()while all we need later on is the theme's name.)#3
Here is an updated patch that does two things:
Thanks for the guidance on this, Dries.
#4
Committed to HEAD along with some small modifications. Thanks Mathias.
#5