[development] low hanging fruit for Drupal 6: variable defaults

Greg Knaddison - GVS Greg at GrowingVentureSolutions.com
Thu May 3 18:55:58 UTC 2007


On 5/3/07, Mohammed Sameer <msameer at foolab.org> wrote:
>
> If we have it as a hook then we don't really need to clean them up in hook_uninstall() because
> drupal can invoke the variables defaults hook, get the list of variables and simply delete
> them from the "registry". We now only have one problem. hook uninstall runs when the module
> is unloaded but then, we can implement the extra hook in the .install file ?
>
> Hope I'm not talking nonsense ;-)
>

I think it makes at least some sense.  My experience from looking at
hook_uninstall solutions is that lots of variables get left around.
The proposed hook_settings() would create some basic variables.    It
would probably not know about _all_ of the variables that the module
may create.  Many variable names are based on variables: e.g.
modulename_contenttype_something.  My solution for that has been to
delete all rows from variable table that start with modulename_  I
think if you try to delete specific variables I think you'll end up
leaving lots of unused keys around.

The realm idea would help a lot with the cleanup, but is not "low
hanging fruit" IMO.

Greg


More information about the development mailing list