[drupal-devel] [feature] Module enabling/initialization hook for
initial setup
nedjo
drupal-devel at drupal.org
Mon Sep 12 17:21:35 UTC 2005
Issue status update for
http://drupal.org/node/31005
Post a follow up:
http://drupal.org/project/comments/add/31005
Project: Drupal
Version: cvs
Component: module system
Category: feature requests
Priority: normal
Assigned to: Anonymous
Reported by: nedjo
Updated by: nedjo
Status: patch (code needs review)
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.
nedjo
More information about the drupal-devel
mailing list