This is a library of tools to assist with writing update hooks.

If you use an update hook deployment workflow, you can end up with a lot of repetitive code for things like disabling a view, enabling or disabling a module, or reverting part or all of a feature. In addition, the existing functions to accomplish these tasks often don't catch exceptions nicely or do basic sanity checking before running. This can cause your update hooks to fail in unexpected ways, often without useful information.

In this module, there are three classes to improve this process.

UpdateApi
Contains all the methods for shortcutting and safeguarding common procedures used in update hooks.

UpdateApiBatch
Simplifies update hooks that run batches by providing an extendable class. Simply provide the IDs to process in one method and the logic to process each one in another.

UpdateApiLog
You probably won't need to use this one. It is used by the other methods to log all actions in the update methods so you get a nice readout in the terminal when the update hook runs.

Drupal 6

The D6 version of this module is no longer supported.

Drupal 7

The D7 version of this module is being actively maintained.

Drupal 8

There is no port to D8 yet.

Supporting organizations: 
maintains this module.

Project information

Releases