0

I'm maintaining a module, and have reworked the file structure of the module to make it more... modular.

In the update functions, some of the new files are referenced, but Drupal isn't aware of the new files until the cache has been cleared. The files are included in the .info file.

Please can someone tell me how to get Drupal to refresh its list of the files in this module?

Thanks,

[Side note - quite surprised that hooks and cache aren't available as tags!]

0

Add a MYMODULE.install file to your module. In there implement hook_update_N to flush all caches. When others update your module, and then do database updates, Drupal will pick up this hook and flushes the cache and your new files will be recognized.

/**
 * Pick up new files.
 */
function MYMODULE_update_7100(&$sandbox) {
  drupal_flush_all_caches();
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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