[drupal-devel] [feature] Module enabling/initialization hook for initial setup

drumm drupal-devel at drupal.org
Mon Sep 12 18:20:54 UTC 2005

Issue status update for 
Post a follow up: 

 Project:      Drupal
 Version:      cvs
 Component:    module system
 Category:     feature requests
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  nedjo
 Updated by:   drumm
 Status:       patch (code needs review)

You don't need to add yet another query for this. The list of previously
enabled modules is availiable from module_list() and the list of now
enabled modules is in $edit.


Previous comments:

Mon, 12 Sep 2005 17:09:19 +0000 : nedjo

Attachment: http://drupal.org/files/issues/module_enable_hook.patch (1.05 KB)

A module often has some one-time setup initialization to do, some of
which can be easily automated (e.g., set a system variable), some of
which may require site admin input.  But there's no available method to
detect and act on module enabling.

So the attached patch implements one possible approach: a new _enable()
hook, that would be called when a module is enabled.

I suppose an alternate approach would be simply to redirect to the
module's setting's page, if available; but, because multiple modules
can be enabled at the same time, that might be impractical.

I know, three days before code freeze is not the best time to be
bringing up new proposed hooks!  I'll be happy to wait until next cycle
to work the idea through.

More information about the drupal-devel mailing list