I have an issue with a theme that gets disabled as soon as cron runs or I clear the cache. Originally, I thought this issue was #344625: Themes disabled on cron or related to #305653: Themes disabled during update; but I'm running 6.14.

I have a subtheme of my site's main theme that is used in certain areas. I have a custom module that sets the global $custom_theme variable in hook_init after a number of conditions are met (path or content type, for instance). This works as expected -- the subtheme inherits elements of the main theme, and the theme is switched when it's supposed to. This subtheme is a new addition to the site, but otherwise seems to work great on my development server.

This is not the site's primary theme; that one stays enabled even when this subtheme is disabled.

What I notice after clearing cache or running cron (in production) is that my subtheme is no longer in the system table. Other themes (Garland, Minelli, my primary theme, my admin theme) are there and the current theme and admin theme remain enabled. When I visit admin/build/themes, or use Drush to execute system_theme_data(), the theme is added back to the system table (albeit disabled, since it was added as a "new" theme and is disabled by default).

I can switch to this disabled theme as long as it's at least in the system table; however I can't edit block settings for this theme, and I'm sure there are other ramifications of using a disabled theme.

To make it more difficult to debug, this only happens in production. I'm not able to replicate this in a development server, even if I use a database and code base snapshot from production. The only significant difference in environments is that the production environment has: 1) dedicated MySQL server instead of using localhost, 2) memcached module running. Since this site is live, I'm hesitant to clear cache with any real frequency or use debug messages like I would if I were able to replicate this in a dev environment.

I've looked at the issues mentioned above; they seem to point at system_theme_data(). When I step through that function (printing status messages every few lines, etc.) I can see that it works as expected. It removes all themes from system, and then adds them back one at a time after scanning the file system. I only seem to have my problem when I clear cache (cron runs, if I execute drush cache clear, or clear the cache from admin/settings/performance).

Comments

kars-t’s picture

Status: Active » Fixed

Hi

I am closing this issue to clean up the issue queue. Feel free to reopen the issue if there is new information and the problem still resides. If not please make sure you close your issues that you don't need any more.

Maybe you can get support from the local user group. Please take a look at this list at groups.drupal.org.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.