6

Sometimes, at least 1 time a month +-, when I visit my site, there is no theme selected and I get a lot of error code.

Notice: Undefined index: highlighted em include() (linha 120 de /var/www/novoportal.faccat.br/htdocs/portal/modules/system/page.tpl.php).
    Notice: Undefined index: sidebar_first em include() (linha 132 de /var/www/novoportal.faccat.br/htdocs/portal/modules/system/page.tpl.php).
    Notice: Undefined index: sidebar_second em include() (linha 138 de /var/www/novoportal.faccat.br/htdocs/portal/modules/system/page.tpl.php).
    Notice: Undefined index: genesis em drupal_theme_initialize() (linha 100 de /var/www/novoportal.faccat.br/htdocs/portal/includes/theme.inc).
    Notice: Trying to get property of non-object em _drupal_theme_initialize() (linha 145 de /var/www/novoportal.faccat.br/htdocs/portal/includes/theme.inc).
    Notice: Trying to get property of non-object em _theme_load_registry() (linha 321 de /var/www/novoportal.faccat.br/htdocs/portal/includes/theme.inc).
    Notice: Undefined index: genesis em theme_get_setting() (linha 1316 de /var/www/novoportal.faccat.br/htdocs/portal/includes/theme.inc).

I always need to select the theme again and clear the cache.

Also I used the Devel theme rebuild tool, but I keep getting these errors.

Any Ideas?

Mete
  • 293
  • 1
  • 4
  • 16

5 Answers5

3

This is what I suggest:

1) First check the .info file and make sure the regions are there as per page.tpl.php. Your error is based on that .

2) If the the above is true then the next thing I would do is make a new fresh installation and only move the sites/all/themes/ folder to it and the db I would then test it to make sure the error does not occur.

Hope it helps.

Vishal Khialani
  • 2,557
  • 6
  • 38
  • 49
  • 1
    This is not a solution if you have a running site with a lot of content. I'm experiencing the exact same bug/error on my installation - it's a nightmare. The theme gets disabled at random intervals. – Larpon Apr 29 '13 at 15:01
1

From your description I think it might be a weird bug in Drupals theme discovery - try calling:

_system_rebuild_theme_data()

One call to it should be enough so don't leave it permanent - as it will cripple your site load times.

I've filed a bug and description.

Edit

The above will probably not fix your problem permanently, I just thought it would at the time of writing.

Larpon
  • 812
  • 6
  • 19
1

I believe this may be caused in some cases by a failed cron run.

I was observing this problem on a dev site where I was basically the only person interacting with it. The problem would surface after a couple of hours of inactivity. The only events in the log would be related to cron runs.

I was able to determine that a normal, user-initiated cron run would not cause the problem.

One type of cron entry was an 'invalid key' error. I investigated and determined that there was a cron job set up to run without a key. After eliminating that cron job, I wasn't able to observe the error any longer.

1

i also had faced similar issue and after installing nucleus https://www.drupal.org/project/nucleus theme (which is required to install any custom theme on drupal7) and secondly I deleted cache entry for my custom theme(drupal_cache table), then above issue resolved.I could see modules now then i went to appearance tab and set my custom theme as Default theme. Hope this would help

DMG
  • 41
  • 3
0

Though I have no answer to this problem, I thought it might come in handy to add some cross links:

  1. "Theme is randomly disabled" at drupal.org
  2. "Themes (custom/derived/new) are disabled at random intervals" at drupal.org

If you find more links, please add them here!

EDIT (2014-10-22): In a multisite environment we had not installed the default site at first. Because of this Drush occasionally generated warnings or errors, so we added a settings.php file to the default site's directory with database credentials of a test site's database. Since we installed the default site with it's own database, the problem fortunately has not occurred anymore. :-)

It might have had something to do with multiple crons being executed on the same database at the same time...?

lmeurs
  • 16,111
  • 4
  • 27
  • 30