2

Essentially I want to be able to monitor all updates to the db system table, by catching all updates to the db system table (for a particular theme's record). We have encountered some odd bugs whereby all themes are periodically (and apparently randomly) disabled, and I need to be able to log further information whenever this theme is disabled. What is the best way to approach this?

Alternatively is there a way to hook into the function for whenever a theme is enabled/disabled?

1 Answer 1

1

You should be able to use hook_themes_disabled().

The following code in a module will put themes being disabled into the Drupal logs:

function MYMODULE_themes_disabled($theme_list) {
  foreach ($theme_list as $key => $themename) {   
    watchdog('MYMODULE', '%themename was disabled.', array('%themename' => $themename), WATCHDOG_NOTICE);
  }
}

EDIT: Forgot to mention this, but hook_themes_enabled() is used in exactly the same way, so you could easily just modify the hook above to check when a theme is enabled.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.