In this issue: http://drupal.org/node/897620 it was decided to use drupal_flush_all_caches() because "many contrib modules (e.g. imagecache) that clear their caches by hooking into drupal_flush_all_caches() are left out of the party."
However, drupal_flush_all_caches() disables all themes. This doesn't become immediately obvious - because the 'default' theme remains the default - however it is no longer 'enabled'. This then means the user can't go to the configuration page for the theme, and also that some modules that extend the theme can't operate (eg skinr).
In standard install profiles in the past I've got round this by using:
drupal_rebuild_theme_registry();
menu_rebuild();
views_invalidate_cache();
node_types_rebuild();
ctools_flush_caches();
cache_clear_all('*', 'cache', TRUE);
cache_clear_all('*', 'cache_content', TRUE);
Is it possible that a sequence of function calls could be used in this way by profiler, rather than drupal_flush_all_caches()?
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | cache_clear.patch | 1.68 KB | lussoluca |
Comments
Comment #1
sirkitree commentedInteresting - I've seen this before on other sites and never found the cause of why a theme is working and set as 'default', but not actually enabled... and yes it did cause problems with skinr... I wonder if devel knows about this...
Comment #2
sirkitree commentedAlso there is another issue where this is a patch to fix role creation with a drupal_flush_all_caches() #954996: Role creation via Features is not complete before User creation
Comment #3
lussolucaThemes are disabled in system_theme_data().
drupal_flush_all_caches() use a version of this function called _system_theme_data() when the site is in maintenance mode in which no themes are disabled. In this patch there is a reimplemented drupal_flush_all_caches() in profiler_api.inc which directly use _system_theme_data() so both problems could be resolved (I hope)
Comment #4
q0rban commentedThis is a duplicate of #1149572: theme = theme_name sets the default theme but does not enable the theme.. Can you move your patch to that issue?