if changes are done to the .info, which is cached also, should be clean as well.

I am trying to submit the patch but I haven't figured out the best way.

By looking at drupal_flush_all_caches() function I am sure that the function zen needs to execute is

  system_theme_data();

I tried adding that to the template.php,v 1.44 file in zen's folder having:

// Auto-rebuild the theme registry during theme development.
if (theme_get_setting('zen_rebuild_registry')) {
  system_theme_data();
  drupal_rebuild_theme_registry();
}

and it seems to work, but only if I realod a page twice, I am not sure about that. I tried registering a shutdown function to clear that part but it breaks things.

I'll post if I look more into it, but it would be a nice/useful improvement.

Comments

cdale’s picture

The reason you need to load up a page twice, is because by the time zen's template.php is loaded up, the theme data for the current page requested has already been processed.

Even calling system_theme_data in a modules hook_init() is too late in the request cycle to have the new data used on the current page.

The only way zen could achieve this without requiring two page loads, would be to have a module that implements hook_boot() as these would be the only modules that are loaded up early enough in the request cycle to effect the theme data in time.

Something like the following would be an implementation for this:


function hook_boot() {
  require_once './includes/common.inc';
  require_once './includes/file.inc';
  drupal_load('module', 'system');
  system_theme_data();
}

Of course, zen is not a module, so it might be better, if adding this feature, to make it very clear in the documentation that two page loads will be required to see changes made in theme.info files. Alternatively, provide a 'zen_themers' module or something that includes the above code.

#308931: Easy & Specific Cache/Registry rebuilding. has a module I wrote that allows a user to clear caches when they want too. It includes all the caches I could find in drupal. The code above is from there, and it does work. It's been quite useful actually. :)

akalata’s picture

Component: Code » layout.css

Is something like this still needed? Or should this issue be closed?

hanoii’s picture

I think it's still needed, although not sure how to achieve it properly. Having a zen helper module side by the theme is probably too much, isn't it?

johnalbin’s picture

Status: Active » Closed (fixed)

6.x-1.x is in bug fix mode only.