drupaldrupal-6

Configuring Drupal modules from within another module


When I create a new Drupal site I usually end up with at least one custom module and several community contributed modules. To get the site working as it should, many configuration values need to be set on the various modules. This makes deployment onto a fresh Drupal instance painstaking and error-prone.

I would like to give my custom module the ability to configure all the other modules. Either on install or on the click of a button on my custom module's administration page, all the necessary configuration values on the other modules would be programmatically set.

How would I best go about doing this?


Solution

  • AFAIK, there's no way to achieve what you mean easily. I tend to put as much as I can in hook_update_N() implementations and do frequent DB synchronisations as described in my answer to this question. However that does not work when you already have a live server with which you will have to merge data.

    To that purpose, I use various tools according to the need. No one is perfect, but here's however a small collection of my favorite ones:

    Finally, you can find a collection of tools for importing/exporting data here.

    HTH!