[drupal-devel] [feature] Module enabling/initialization hook for initial setup
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
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: 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. drumm 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.
participants (2)
-
drumm -
nedjo