I'm finding that every small change I make to the hooks I have to disable and re-enable a module. Is there a easy way to do this than having to go through to the module menu, uncheck the module, click save configuration and wait for a while, then recheck the module, and click save configuration again?
4 Answers
The devel module includes a page that will let you disable and re-enable modules in a single step. The page can be hard to find though, but if you enable one of the Devel blocks, it's listed in there.
You can also do it relatively easily from the command line using Drush.
For quick disabling and re-enabling of modules, try drush dre module1, module2
.
This is a Devel command, so you need to have that installed, and enabled. You just need to be sure you put them in the right order according to their relative dependencies; should module1 be dependent on module2, it wouldn't work.
Using Drush from the command line saves a lot of time, not only with enabling and disabling modules, but installing, updating, and many other tasks. It's a very powerful tool useful for many Drupal development tasks.
For example, to enable the module using drush you'd type (in terminal) drush en modulename
. To disable same module you'd enter drush dis modulename
. Much quicker than going through the admin UI.
However, your problem may be resolved by clearing the cache as the only hooks directly effected are hook_schema
, hook_enable
, hook_disable
, hook_uninstall
, and hook_install
(you can also clear the cache in Drush using the command drush cc all
).
If you have lots of modules to enable and disable, just create a module that will enable/disable a selection of modules all in one go. Then use drush dis on that module do disable all the modules.